1 | import { Disposable, TextDocument, ProviderResult, EventEmitter, CodeLensProvider, CodeLens as VCodeLens } from 'vscode';
|
2 | import { ClientCapabilities, CancellationToken, ServerCapabilities, DocumentSelector, CodeLensOptions, CodeLensRegistrationOptions } from 'vscode-languageserver-protocol';
|
3 | import { TextDocumentLanguageFeature, FeatureClient } from './features';
|
4 | export interface ProvideCodeLensesSignature {
|
5 | (this: void, document: TextDocument, token: CancellationToken): ProviderResult<VCodeLens[]>;
|
6 | }
|
7 | export interface ResolveCodeLensSignature {
|
8 | (this: void, codeLens: VCodeLens, token: CancellationToken): ProviderResult<VCodeLens>;
|
9 | }
|
10 | export interface CodeLensMiddleware {
|
11 | provideCodeLenses?: (this: void, document: TextDocument, token: CancellationToken, next: ProvideCodeLensesSignature) => ProviderResult<VCodeLens[]>;
|
12 | resolveCodeLens?: (this: void, codeLens: VCodeLens, token: CancellationToken, next: ResolveCodeLensSignature) => ProviderResult<VCodeLens>;
|
13 | }
|
14 | export type CodeLensProviderShape = {
|
15 | provider?: CodeLensProvider;
|
16 | onDidChangeCodeLensEmitter: EventEmitter<void>;
|
17 | };
|
18 | export declare class CodeLensFeature extends TextDocumentLanguageFeature<CodeLensOptions, CodeLensRegistrationOptions, CodeLensProviderShape, CodeLensMiddleware> {
|
19 | constructor(client: FeatureClient<CodeLensMiddleware>);
|
20 | fillClientCapabilities(capabilities: ClientCapabilities): void;
|
21 | initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void;
|
22 | protected registerLanguageProvider(options: CodeLensRegistrationOptions): [Disposable, CodeLensProviderShape];
|
23 | }
|