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

Function FormatSelection

internal/format/api.go:115–117  ·  view source on GitHub ↗
(ctx context.Context, sourceFile *ast.SourceFile, start int, end int)

Source from the content-addressed store, hash-verified

113}
114
115func FormatSelection(ctx context.Context, sourceFile *ast.SourceFile, start int, end int) []core.TextChange {
116 return FormatSpan(ctx, core.NewTextRange(GetLineStartPositionForPosition(start, sourceFile), end), sourceFile, FormatRequestKindFormatSelection)
117}
118
119func FormatOnOpeningCurly(ctx context.Context, sourceFile *ast.SourceFile, position int) []core.TextChange {
120 openingCurly := findImmediatelyPrecedingTokenOfKind(position, ast.KindOpenBraceToken, sourceFile)

Calls 3

NewTextRangeFunction · 0.92
FormatSpanFunction · 0.85

Tested by 1