( ctx context.Context, documentURI lsproto.DocumentUri, options *lsproto.FormattingOptions, )
| 25 | } |
| 26 | |
| 27 | func (l *LanguageService) ProvideFormatDocument( |
| 28 | ctx context.Context, |
| 29 | documentURI lsproto.DocumentUri, |
| 30 | options *lsproto.FormattingOptions, |
| 31 | ) (lsproto.DocumentFormattingResponse, error) { |
| 32 | if l.UserPreferences().EnableFormatting.IsFalse() { |
| 33 | return lsproto.TextEditsOrNull{}, nil |
| 34 | } |
| 35 | _, file := l.getProgramAndFile(documentURI) |
| 36 | formatOpts := lsutil.FromLSFormatOptions(l.FormatOptions(), options) |
| 37 | edits := l.toLSProtoTextEdits(file, l.getFormattingEditsForDocument( |
| 38 | ctx, |
| 39 | file, |
| 40 | formatOpts, |
| 41 | )) |
| 42 | return lsproto.TextEditsOrNull{TextEdits: &edits}, nil |
| 43 | } |
| 44 | |
| 45 | func (l *LanguageService) ProvideFormatDocumentRange( |
| 46 | ctx context.Context, |
no test coverage detected