import { Disposable, TextDocument, ProviderResult, EventEmitter, CodeLensProvider, CodeLens as VCodeLens } from 'vscode'; import { ClientCapabilities, CancellationToken, ServerCapabilities, DocumentSelector, CodeLensOptions, CodeLensRegistrationOptions } from 'vscode-languageserver-protocol'; import { TextDocumentLanguageFeature, FeatureClient } from './features'; export interface ProvideCodeLensesSignature { (this: void, document: TextDocument, token: CancellationToken): ProviderResult; } export interface ResolveCodeLensSignature { (this: void, codeLens: VCodeLens, token: CancellationToken): ProviderResult; } export interface CodeLensMiddleware { provideCodeLenses?: (this: void, document: TextDocument, token: CancellationToken, next: ProvideCodeLensesSignature) => ProviderResult; resolveCodeLens?: (this: void, codeLens: VCodeLens, token: CancellationToken, next: ResolveCodeLensSignature) => ProviderResult; } export type CodeLensProviderShape = { provider?: CodeLensProvider; onDidChangeCodeLensEmitter: EventEmitter; }; export declare class CodeLensFeature extends TextDocumentLanguageFeature { constructor(client: FeatureClient); fillClientCapabilities(capabilities: ClientCapabilities): void; initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; protected registerLanguageProvider(options: CodeLensRegistrationOptions): [Disposable, CodeLensProviderShape]; }