UNPKG

1.56 kBTypeScriptView Raw
1import { TextDocument, Disposable, CancellationToken, ProviderResult, DocumentLinkProvider, DocumentLink as VDocumentLink } from 'vscode';
2import { ClientCapabilities, DocumentLinkOptions, DocumentLinkRegistrationOptions, DocumentSelector, ServerCapabilities } from 'vscode-languageserver-protocol';
3import { FeatureClient, TextDocumentLanguageFeature } from './features';
4export interface ProvideDocumentLinksSignature {
5 (this: void, document: TextDocument, token: CancellationToken): ProviderResult<VDocumentLink[]>;
6}
7export interface ResolveDocumentLinkSignature {
8 (this: void, link: VDocumentLink, token: CancellationToken): ProviderResult<VDocumentLink>;
9}
10export interface DocumentLinkMiddleware {
11 provideDocumentLinks?: (this: void, document: TextDocument, token: CancellationToken, next: ProvideDocumentLinksSignature) => ProviderResult<VDocumentLink[]>;
12 resolveDocumentLink?: (this: void, link: VDocumentLink, token: CancellationToken, next: ResolveDocumentLinkSignature) => ProviderResult<VDocumentLink>;
13}
14export declare class DocumentLinkFeature extends TextDocumentLanguageFeature<DocumentLinkOptions, DocumentLinkRegistrationOptions, DocumentLinkProvider, DocumentLinkMiddleware> {
15 constructor(client: FeatureClient<DocumentLinkMiddleware>);
16 fillClientCapabilities(capabilities: ClientCapabilities): void;
17 initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void;
18 protected registerLanguageProvider(options: DocumentLinkRegistrationOptions): [Disposable, DocumentLinkProvider];
19}