1 | import { Disposable, TextDocument, ProviderResult, FoldingRange as VFoldingRange, FoldingContext, FoldingRangeProvider, EventEmitter } from 'vscode';
|
2 | import { ClientCapabilities, CancellationToken, ServerCapabilities, DocumentSelector, FoldingRangeRegistrationOptions, FoldingRangeOptions } from 'vscode-languageserver-protocol';
|
3 | import { TextDocumentLanguageFeature, FeatureClient } from './features';
|
4 | export interface ProvideFoldingRangeSignature {
|
5 | (this: void, document: TextDocument, context: FoldingContext, token: CancellationToken): ProviderResult<VFoldingRange[]>;
|
6 | }
|
7 | export interface FoldingRangeProviderMiddleware {
|
8 | provideFoldingRanges?: (this: void, document: TextDocument, context: FoldingContext, token: CancellationToken, next: ProvideFoldingRangeSignature) => ProviderResult<VFoldingRange[]>;
|
9 | }
|
10 | export type FoldingRangeProviderShape = {
|
11 | provider: FoldingRangeProvider;
|
12 | onDidChangeFoldingRange: EventEmitter<void>;
|
13 | };
|
14 | export declare class FoldingRangeFeature extends TextDocumentLanguageFeature<boolean | FoldingRangeOptions, FoldingRangeRegistrationOptions, FoldingRangeProviderShape, FoldingRangeProviderMiddleware> {
|
15 | constructor(client: FeatureClient<FoldingRangeProviderMiddleware>);
|
16 | fillClientCapabilities(capabilities: ClientCapabilities): void;
|
17 | initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void;
|
18 | protected registerLanguageProvider(options: FoldingRangeRegistrationOptions): [Disposable, FoldingRangeProviderShape];
|
19 | }
|