Skip to content

Commit 8def3a6

Browse files
committed
feat: support VSCode API: provideDocumentRangesFormattingEdits
1 parent 3383a0d commit 8def3a6

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

packages/types/vscode/typings/vscode.language.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,6 +2375,25 @@ declare module 'vscode' {
23752375
* signaled by returning `undefined`, `null`, or an empty array.
23762376
*/
23772377
provideDocumentRangeFormattingEdits(document: TextDocument, range: Range, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
2378+
2379+
/**
2380+
* Provide formatting edits for multiple ranges in a document.
2381+
*
2382+
* This function is optional but allows a formatter to perform faster when formatting only modified ranges or when
2383+
* formatting a large number of selections.
2384+
*
2385+
* The given ranges are hints and providers can decide to format a smaller
2386+
* or larger range. Often this is done by adjusting the start and end
2387+
* of the range to full syntax nodes.
2388+
*
2389+
* @param document The document in which the command was invoked.
2390+
* @param ranges The ranges which should be formatted.
2391+
* @param options Options controlling formatting.
2392+
* @param token A cancellation token.
2393+
* @returns A set of text edits or a thenable that resolves to such. The lack of a result can be
2394+
* signaled by returning `undefined`, `null`, or an empty array.
2395+
*/
2396+
provideDocumentRangesFormattingEdits?(document: TextDocument, ranges: Range[], options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
23782397
}
23792398

23802399
/**

0 commit comments

Comments
 (0)