1 | import * as vscode from 'vscode';
|
2 | import { ClientCapabilities, ServerCapabilities, DocumentSelector, SemanticTokensOptions, SemanticTokensRegistrationOptions } from 'vscode-languageserver-protocol';
|
3 | import { FeatureClient, TextDocumentLanguageFeature } from './features';
|
4 | export interface DocumentSemanticsTokensSignature {
|
5 | (this: void, document: vscode.TextDocument, token: vscode.CancellationToken): vscode.ProviderResult<vscode.SemanticTokens>;
|
6 | }
|
7 | export interface DocumentSemanticsTokensEditsSignature {
|
8 | (this: void, document: vscode.TextDocument, previousResultId: string, token: vscode.CancellationToken): vscode.ProviderResult<vscode.SemanticTokensEdits | vscode.SemanticTokens>;
|
9 | }
|
10 | export interface DocumentRangeSemanticTokensSignature {
|
11 | (this: void, document: vscode.TextDocument, range: vscode.Range, token: vscode.CancellationToken): vscode.ProviderResult<vscode.SemanticTokens>;
|
12 | }
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | export interface SemanticTokensMiddleware {
|
19 | provideDocumentSemanticTokens?: (this: void, document: vscode.TextDocument, token: vscode.CancellationToken, next: DocumentSemanticsTokensSignature) => vscode.ProviderResult<vscode.SemanticTokens>;
|
20 | provideDocumentSemanticTokensEdits?: (this: void, document: vscode.TextDocument, previousResultId: string, token: vscode.CancellationToken, next: DocumentSemanticsTokensEditsSignature) => vscode.ProviderResult<vscode.SemanticTokensEdits | vscode.SemanticTokens>;
|
21 | provideDocumentRangeSemanticTokens?: (this: void, document: vscode.TextDocument, range: vscode.Range, token: vscode.CancellationToken, next: DocumentRangeSemanticTokensSignature) => vscode.ProviderResult<vscode.SemanticTokens>;
|
22 | }
|
23 | export interface SemanticTokensProviderShape {
|
24 | range?: vscode.DocumentRangeSemanticTokensProvider;
|
25 | full?: vscode.DocumentSemanticTokensProvider;
|
26 | onDidChangeSemanticTokensEmitter: vscode.EventEmitter<void>;
|
27 | }
|
28 | export declare class SemanticTokensFeature extends TextDocumentLanguageFeature<boolean | SemanticTokensOptions, SemanticTokensRegistrationOptions, SemanticTokensProviderShape, SemanticTokensMiddleware> {
|
29 | constructor(client: FeatureClient<SemanticTokensMiddleware>);
|
30 | fillClientCapabilities(capabilities: ClientCapabilities): void;
|
31 | initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void;
|
32 | protected registerLanguageProvider(options: SemanticTokensRegistrationOptions): [vscode.Disposable, SemanticTokensProviderShape];
|
33 | }
|