1 | import { TextDocument, Disposable, Position as VPosition, CompletionContext as VCompletionContext, CancellationToken, ProviderResult, CompletionItem as VCompletionItem, CompletionList as VCompletionList, CompletionItemProvider } from 'vscode';
|
2 | import { ClientCapabilities, CompletionOptions, CompletionRegistrationOptions, DocumentSelector, ServerCapabilities } from 'vscode-languageserver-protocol';
|
3 | import { FeatureClient, TextDocumentLanguageFeature } from './features';
|
4 | export interface ProvideCompletionItemsSignature {
|
5 | (this: void, document: TextDocument, position: VPosition, context: VCompletionContext, token: CancellationToken): ProviderResult<VCompletionItem[] | VCompletionList>;
|
6 | }
|
7 | export interface ResolveCompletionItemSignature {
|
8 | (this: void, item: VCompletionItem, token: CancellationToken): ProviderResult<VCompletionItem>;
|
9 | }
|
10 | export interface CompletionMiddleware {
|
11 | provideCompletionItem?: (this: void, document: TextDocument, position: VPosition, context: VCompletionContext, token: CancellationToken, next: ProvideCompletionItemsSignature) => ProviderResult<VCompletionItem[] | VCompletionList>;
|
12 | resolveCompletionItem?: (this: void, item: VCompletionItem, token: CancellationToken, next: ResolveCompletionItemSignature) => ProviderResult<VCompletionItem>;
|
13 | }
|
14 | export declare class CompletionItemFeature extends TextDocumentLanguageFeature<CompletionOptions, CompletionRegistrationOptions, CompletionItemProvider, CompletionMiddleware> {
|
15 | private labelDetailsSupport;
|
16 | constructor(client: FeatureClient<CompletionMiddleware>);
|
17 | fillClientCapabilities(capabilities: ClientCapabilities): void;
|
18 | initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void;
|
19 | protected registerLanguageProvider(options: CompletionRegistrationOptions, id: string): [Disposable, CompletionItemProvider];
|
20 | }
|