1 | import { Disposable, TextDocument, ProviderResult, Range as VRange, Command as VCommand, CodeAction as VCodeAction, CodeActionContext as VCodeActionContext, CodeActionProvider } from 'vscode';
|
2 | import { ClientCapabilities, CancellationToken, ServerCapabilities, DocumentSelector, CodeActionOptions, CodeActionRegistrationOptions } from 'vscode-languageserver-protocol';
|
3 | import { TextDocumentLanguageFeature, FeatureClient } from './features';
|
4 | export interface ProvideCodeActionsSignature {
|
5 | (this: void, document: TextDocument, range: VRange, context: VCodeActionContext, token: CancellationToken): ProviderResult<(VCommand | VCodeAction)[]>;
|
6 | }
|
7 | export interface ResolveCodeActionSignature {
|
8 | (this: void, item: VCodeAction, token: CancellationToken): ProviderResult<VCodeAction>;
|
9 | }
|
10 | export interface CodeActionMiddleware {
|
11 | provideCodeActions?: (this: void, document: TextDocument, range: VRange, context: VCodeActionContext, token: CancellationToken, next: ProvideCodeActionsSignature) => ProviderResult<(VCommand | VCodeAction)[]>;
|
12 | resolveCodeAction?: (this: void, item: VCodeAction, token: CancellationToken, next: ResolveCodeActionSignature) => ProviderResult<VCodeAction>;
|
13 | }
|
14 | export declare class CodeActionFeature extends TextDocumentLanguageFeature<boolean | CodeActionOptions, CodeActionRegistrationOptions, CodeActionProvider, CodeActionMiddleware> {
|
15 | constructor(client: FeatureClient<CodeActionMiddleware>);
|
16 | fillClientCapabilities(capabilities: ClientCapabilities): void;
|
17 | initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void;
|
18 | protected registerLanguageProvider(options: CodeActionRegistrationOptions): [Disposable, CodeActionProvider];
|
19 | }
|