( ctx context.Context, documentURI lsproto.DocumentUri, options *lsproto.FormattingOptions, r lsproto.Range, )
| 43 | } |
| 44 | |
| 45 | func (l *LanguageService) ProvideFormatDocumentRange( |
| 46 | ctx context.Context, |
| 47 | documentURI lsproto.DocumentUri, |
| 48 | options *lsproto.FormattingOptions, |
| 49 | r lsproto.Range, |
| 50 | ) (lsproto.DocumentRangeFormattingResponse, error) { |
| 51 | if l.UserPreferences().EnableFormatting.IsFalse() { |
| 52 | return lsproto.TextEditsOrNull{}, nil |
| 53 | } |
| 54 | _, file := l.getProgramAndFile(documentURI) |
| 55 | formatOpts := lsutil.FromLSFormatOptions(l.FormatOptions(), options) |
| 56 | edits := l.toLSProtoTextEdits(file, l.getFormattingEditsForRange( |
| 57 | ctx, |
| 58 | file, |
| 59 | formatOpts, |
| 60 | l.converters.FromLSPRange(file, r), |
| 61 | )) |
| 62 | return lsproto.TextEditsOrNull{TextEdits: &edits}, nil |
| 63 | } |
| 64 | |
| 65 | func (l *LanguageService) ProvideFormatDocumentOnType( |
| 66 | ctx context.Context, |
no test coverage detected