UNPKG

1.45 kBTypeScriptView Raw
1import { TextDocument, Disposable, Position as VPosition, CancellationToken, ProviderResult, DocumentHighlightProvider, DocumentHighlight as VDocumentHighlight } from 'vscode';
2import { ClientCapabilities, DocumentHighlightOptions, DocumentHighlightRegistrationOptions, DocumentSelector, ServerCapabilities, TextDocumentRegistrationOptions } from 'vscode-languageserver-protocol';
3import { FeatureClient, TextDocumentLanguageFeature } from './features';
4export interface ProvideDocumentHighlightsSignature {
5 (this: void, document: TextDocument, position: VPosition, token: CancellationToken): ProviderResult<VDocumentHighlight[]>;
6}
7export interface DocumentHighlightMiddleware {
8 provideDocumentHighlights?: (this: void, document: TextDocument, position: VPosition, token: CancellationToken, next: ProvideDocumentHighlightsSignature) => ProviderResult<VDocumentHighlight[]>;
9}
10export declare class DocumentHighlightFeature extends TextDocumentLanguageFeature<boolean | DocumentHighlightOptions, DocumentHighlightRegistrationOptions, DocumentHighlightProvider, DocumentHighlightMiddleware> {
11 constructor(client: FeatureClient<DocumentHighlightMiddleware>);
12 fillClientCapabilities(capabilities: ClientCapabilities): void;
13 initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void;
14 protected registerLanguageProvider(options: TextDocumentRegistrationOptions): [Disposable, DocumentHighlightProvider];
15}