import { Disposable, TextDocument, ProviderResult, Range as VRange, Position as VPosition, TextEdit as VTextEdit, FormattingOptions as VFormattingOptions, DocumentFormattingEditProvider, DocumentRangeFormattingEditProvider, OnTypeFormattingEditProvider } from 'vscode'; import { ClientCapabilities, CancellationToken, ServerCapabilities, DocumentSelector, DocumentHighlightRegistrationOptions, DocumentFormattingOptions, TextDocumentRegistrationOptions, DocumentRangeFormattingRegistrationOptions, DocumentRangeFormattingOptions, DocumentOnTypeFormattingOptions, DocumentOnTypeFormattingRegistrationOptions } from 'vscode-languageserver-protocol'; import { TextDocumentLanguageFeature, FeatureClient } from './features'; export interface ProvideDocumentFormattingEditsSignature { (this: void, document: TextDocument, options: VFormattingOptions, token: CancellationToken): ProviderResult; } export interface ProvideDocumentRangeFormattingEditsSignature { (this: void, document: TextDocument, range: VRange, options: VFormattingOptions, token: CancellationToken): ProviderResult; } export interface ProvideDocumentRangesFormattingEditsSignature { (this: void, document: TextDocument, ranges: VRange[], options: VFormattingOptions, token: CancellationToken): ProviderResult; } export interface ProvideOnTypeFormattingEditsSignature { (this: void, document: TextDocument, position: VPosition, ch: string, options: VFormattingOptions, token: CancellationToken): ProviderResult; } export interface FormattingMiddleware { provideDocumentFormattingEdits?: (this: void, document: TextDocument, options: VFormattingOptions, token: CancellationToken, next: ProvideDocumentFormattingEditsSignature) => ProviderResult; provideDocumentRangeFormattingEdits?: (this: void, document: TextDocument, range: VRange, options: VFormattingOptions, token: CancellationToken, next: ProvideDocumentRangeFormattingEditsSignature) => ProviderResult; provideDocumentRangesFormattingEdits?: (this: void, document: TextDocument, range: VRange[], options: VFormattingOptions, token: CancellationToken, next: ProvideDocumentRangesFormattingEditsSignature) => ProviderResult; provideOnTypeFormattingEdits?: (this: void, document: TextDocument, position: VPosition, ch: string, options: VFormattingOptions, token: CancellationToken, next: ProvideOnTypeFormattingEditsSignature) => ProviderResult; } export declare class DocumentFormattingFeature extends TextDocumentLanguageFeature { constructor(client: FeatureClient); fillClientCapabilities(capabilities: ClientCapabilities): void; initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; protected registerLanguageProvider(options: TextDocumentRegistrationOptions): [Disposable, DocumentFormattingEditProvider]; } export declare class DocumentRangeFormattingFeature extends TextDocumentLanguageFeature { constructor(client: FeatureClient); fillClientCapabilities(capabilities: ClientCapabilities): void; initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; protected registerLanguageProvider(options: DocumentRangeFormattingRegistrationOptions): [Disposable, DocumentRangeFormattingEditProvider]; } export declare class DocumentOnTypeFormattingFeature extends TextDocumentLanguageFeature { constructor(client: FeatureClient); fillClientCapabilities(capabilities: ClientCapabilities): void; initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; protected registerLanguageProvider(options: DocumentOnTypeFormattingRegistrationOptions): [Disposable, OnTypeFormattingEditProvider]; }