UNPKG

1.33 kBTypeScriptView Raw
1import { Disposable, TextDocument, ProviderResult, Position as VPosition, Declaration as VDeclaration, DeclarationProvider } from 'vscode';
2import { ClientCapabilities, CancellationToken, ServerCapabilities, DocumentSelector, DeclarationRegistrationOptions, DeclarationOptions } from 'vscode-languageserver-protocol';
3import { TextDocumentLanguageFeature, FeatureClient } from './features';
4export interface ProvideDeclarationSignature {
5 (this: void, document: TextDocument, position: VPosition, token: CancellationToken): ProviderResult<VDeclaration>;
6}
7export interface DeclarationMiddleware {
8 provideDeclaration?: (this: void, document: TextDocument, position: VPosition, token: CancellationToken, next: ProvideDeclarationSignature) => ProviderResult<VDeclaration>;
9}
10export declare class DeclarationFeature extends TextDocumentLanguageFeature<boolean | DeclarationOptions, DeclarationRegistrationOptions, DeclarationProvider, DeclarationMiddleware> {
11 constructor(client: FeatureClient<DeclarationMiddleware>);
12 fillClientCapabilities(capabilities: ClientCapabilities): void;
13 initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void;
14 protected registerLanguageProvider(options: DeclarationRegistrationOptions): [Disposable, DeclarationProvider];
15 private registerProvider;
16}