import { Disposable, TextDocument, ProviderResult, FoldingRange as VFoldingRange, FoldingContext, FoldingRangeProvider, EventEmitter } from 'vscode'; import { ClientCapabilities, CancellationToken, ServerCapabilities, DocumentSelector, FoldingRangeRegistrationOptions, FoldingRangeOptions } from 'vscode-languageserver-protocol'; import { TextDocumentLanguageFeature, FeatureClient } from './features'; export interface ProvideFoldingRangeSignature { (this: void, document: TextDocument, context: FoldingContext, token: CancellationToken): ProviderResult; } export interface FoldingRangeProviderMiddleware { provideFoldingRanges?: (this: void, document: TextDocument, context: FoldingContext, token: CancellationToken, next: ProvideFoldingRangeSignature) => ProviderResult; } export type FoldingRangeProviderShape = { provider: FoldingRangeProvider; onDidChangeFoldingRange: EventEmitter; }; export declare class FoldingRangeFeature extends TextDocumentLanguageFeature { constructor(client: FeatureClient); fillClientCapabilities(capabilities: ClientCapabilities): void; initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; protected registerLanguageProvider(options: FoldingRangeRegistrationOptions): [Disposable, FoldingRangeProviderShape]; }