Interface Formatter

Language specific service for handling formatting related LSP requests.

interface Formatter {
    get formatOnTypeOptions(): undefined | DocumentOnTypeFormattingOptions;
    formatDocument(document: LangiumDocument<AstNode>, params: DocumentFormattingParams, cancelToken?: CancellationToken): MaybePromise<TextEdit[]>;
    formatDocumentOnType(document: LangiumDocument<AstNode>, params: DocumentOnTypeFormattingParams, cancelToken?: CancellationToken): MaybePromise<TextEdit[]>;
    formatDocumentRange(document: LangiumDocument<AstNode>, params: DocumentRangeFormattingParams, cancelToken?: CancellationToken): MaybePromise<TextEdit[]>;
}

Implemented by

Accessors

  • get formatOnTypeOptions(): undefined | DocumentOnTypeFormattingOptions
  • Options that determine when the formatDocumentOnType method should be invoked by the language client. When undefined is returned, document format on type will be disabled.

    Returns undefined | DocumentOnTypeFormattingOptions

Methods