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

Function FormatDocument

internal/format/api.go:111–113  ·  view source on GitHub ↗
(ctx context.Context, sourceFile *ast.SourceFile)

Source from the content-addressed store, hash-verified

109}
110
111func FormatDocument(ctx context.Context, sourceFile *ast.SourceFile) []core.TextChange {
112 return FormatSpan(ctx, core.NewTextRange(0, sourceFile.End()), sourceFile, FormatRequestKindFormatDocument)
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)

Callers 8

fmtMainFunction · 0.92
TestCommentFormattingFunction · 0.92
TestSliceBoundsPanicFunction · 0.92
TestFormatFunction · 0.92
BenchmarkFormatFunction · 0.92

Calls 3

NewTextRangeFunction · 0.92
FormatSpanFunction · 0.85
EndMethod · 0.65

Tested by 6

TestCommentFormattingFunction · 0.74
TestSliceBoundsPanicFunction · 0.74
TestFormatFunction · 0.74
BenchmarkFormatFunction · 0.74