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

Method getFormattingEditsForRange

internal/ls/format.go:87–95  ·  view source on GitHub ↗
(
	ctx context.Context,
	file *ast.SourceFile,
	options lsutil.FormatCodeSettings,
	r core.TextRange,
)

Source from the content-addressed store, hash-verified

85}
86
87func (l *LanguageService) getFormattingEditsForRange(
88 ctx context.Context,
89 file *ast.SourceFile,
90 options lsutil.FormatCodeSettings,
91 r core.TextRange,
92) []core.TextChange {
93 ctx = format.WithFormatCodeSettings(ctx, options, options.NewLineCharacter)
94 return format.FormatSelection(ctx, file, r.Pos(), r.End())
95}
96
97func (l *LanguageService) getFormattingEditsForDocument(
98 ctx context.Context,

Calls 4

WithFormatCodeSettingsFunction · 0.92
FormatSelectionFunction · 0.92
PosMethod · 0.65
EndMethod · 0.65