Method
getFormattingEditsForRange
(
ctx context.Context,
file *ast.SourceFile,
options lsutil.FormatCodeSettings,
r core.TextRange,
)
Source from the content-addressed store, hash-verified
| 85 | } |
| 86 | |
| 87 | func (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 | |
| 97 | func (l *LanguageService) getFormattingEditsForDocument( |
| 98 | ctx context.Context, |