1.39 kBTypeScriptView Raw
1import { TextDocument, Disposable, Position as VPosition, CancellationToken, ProviderResult, DefinitionProvider, Definition as VDefinition, DefinitionLink as VDefinitionLink } from 'vscode';
2import { ClientCapabilities, DefinitionOptions, DefinitionRegistrationOptions, DocumentSelector, ServerCapabilities } from 'vscode-languageserver-protocol';
3import { FeatureClient, TextDocumentLanguageFeature } from './features';
4export interface ProvideDefinitionSignature {
5 (this: void, document: TextDocument, position: VPosition, token: CancellationToken): ProviderResult<VDefinition | VDefinitionLink[]>;
6}
7export interface DefinitionMiddleware {
8 provideDefinition?: (this: void, document: TextDocument, position: VPosition, token: CancellationToken, next: ProvideDefinitionSignature) => ProviderResult<VDefinition | VDefinitionLink[]>;
9}
10export declare class DefinitionFeature extends TextDocumentLanguageFeature<boolean | DefinitionOptions, DefinitionRegistrationOptions, DefinitionProvider, DefinitionMiddleware> {
11 constructor(client: FeatureClient<DefinitionMiddleware>);
12 fillClientCapabilities(capabilities: ClientCapabilities): void;
13 initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void;
14 protected registerLanguageProvider(options: DefinitionRegistrationOptions): [Disposable, DefinitionProvider];
15 private registerProvider;
16}