MCPcopy Create free account
hub / github.com/microsoft/typescript-go / toLSProtoTextEdits

Method toLSProtoTextEdits

internal/ls/format.go:16–25  ·  view source on GitHub ↗
(file *ast.SourceFile, changes []core.TextChange)

Source from the content-addressed store, hash-verified

14)
15
16func (l *LanguageService) toLSProtoTextEdits(file *ast.SourceFile, changes []core.TextChange) []*lsproto.TextEdit {
17 result := make([]*lsproto.TextEdit, 0, len(changes))
18 for _, c := range changes {
19 result = append(result, &lsproto.TextEdit{
20 NewText: c.NewText,
21 Range: l.createLspRangeFromBounds(c.Pos(), c.End(), file),
22 })
23 }
24 return result
25}
26
27func (l *LanguageService) ProvideFormatDocument(
28 ctx context.Context,

Callers 3

ProvideFormatDocumentMethod · 0.95

Calls 6

lenFunction · 0.85
PosMethod · 0.65
EndMethod · 0.65
makeFunction · 0.50
appendFunction · 0.50

Tested by

no test coverage detected