The document formatting provider interface defines the contract between extensions and the formatting-feature.

Fields

provideDocumentFormattingEdits(document:TextDocument, options:FormattingOptions, token:CancellationToken):ProviderResult<Array<TextEdit>>

Provide formatting edits for a whole document.

Parameters:

document

The document in which the command was invoked.

options

Options controlling formatting.

token

A cancellation token.

Returns:

A set of text edits or a thenable that resolves to such. The lack of a result can be signaled by returning undefined, null, or an empty array.