UNPKG

1.22 kBTypeScriptView Raw
1import { TextDocument, Disposable, Position as VPosition, CancellationToken, ProviderResult, HoverProvider, Hover as VHover } from 'vscode';
2import { ClientCapabilities, DocumentSelector, HoverOptions, HoverRegistrationOptions, ServerCapabilities } from 'vscode-languageserver-protocol';
3import { FeatureClient, TextDocumentLanguageFeature } from './features';
4export interface ProvideHoverSignature {
5 (this: void, document: TextDocument, position: VPosition, token: CancellationToken): ProviderResult<VHover>;
6}
7export interface HoverMiddleware {
8 provideHover?: (this: void, document: TextDocument, position: VPosition, token: CancellationToken, next: ProvideHoverSignature) => ProviderResult<VHover>;
9}
10export declare class HoverFeature extends TextDocumentLanguageFeature<boolean | HoverOptions, HoverRegistrationOptions, HoverProvider, HoverMiddleware> {
11 constructor(client: FeatureClient<HoverMiddleware>);
12 fillClientCapabilities(capabilities: ClientCapabilities): void;
13 initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void;
14 protected registerLanguageProvider(options: HoverRegistrationOptions): [Disposable, HoverProvider];
15 private registerProvider;
16}