massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-json / node_modules / vscode-languageserver-protocol / lib / common / protocol.semanticTokens.d.ts
1 import { TextDocumentIdentifier, Range, uinteger } from 'vscode-languageserver-types';
2 import { RequestHandler0, RequestHandler } from 'vscode-jsonrpc';
3 import { ProtocolRequestType, ProtocolRequestType0, RegistrationType } from './messages';
4 import { PartialResultParams, WorkDoneProgressParams, WorkDoneProgressOptions, TextDocumentRegistrationOptions, StaticRegistrationOptions } from './protocol';
5 /**
6  * A set of predefined token types. This set is not fixed
7  * an clients can specify additional token types via the
8  * corresponding client capabilities.
9  *
10  * @since 3.16.0
11  */
12 export declare enum SemanticTokenTypes {
13     namespace = "namespace",
14     /**
15      * Represents a generic type. Acts as a fallback for types which can't be mapped to
16      * a specific type like class or enum.
17      */
18     type = "type",
19     class = "class",
20     enum = "enum",
21     interface = "interface",
22     struct = "struct",
23     typeParameter = "typeParameter",
24     parameter = "parameter",
25     variable = "variable",
26     property = "property",
27     enumMember = "enumMember",
28     event = "event",
29     function = "function",
30     method = "method",
31     macro = "macro",
32     keyword = "keyword",
33     modifier = "modifier",
34     comment = "comment",
35     string = "string",
36     number = "number",
37     regexp = "regexp",
38     operator = "operator"
39 }
40 /**
41  * A set of predefined token modifiers. This set is not fixed
42  * an clients can specify additional token types via the
43  * corresponding client capabilities.
44  *
45  * @since 3.16.0
46  */
47 export declare enum SemanticTokenModifiers {
48     declaration = "declaration",
49     definition = "definition",
50     readonly = "readonly",
51     static = "static",
52     deprecated = "deprecated",
53     abstract = "abstract",
54     async = "async",
55     modification = "modification",
56     documentation = "documentation",
57     defaultLibrary = "defaultLibrary"
58 }
59 /**
60  * @since 3.16.0
61  */
62 export interface SemanticTokensLegend {
63     /**
64      * The token types a server uses.
65      */
66     tokenTypes: string[];
67     /**
68      * The token modifiers a server uses.
69      */
70     tokenModifiers: string[];
71 }
72 /**
73  * @since 3.16.0
74  */
75 export interface SemanticTokens {
76     /**
77      * An optional result id. If provided and clients support delta updating
78      * the client will include the result id in the next semantic token request.
79      * A server can then instead of computing all semantic tokens again simply
80      * send a delta.
81      */
82     resultId?: string;
83     /**
84      * The actual tokens.
85      */
86     data: uinteger[];
87 }
88 /**
89  * @since 3.16.0
90  */
91 export declare namespace SemanticTokens {
92     function is(value: any): value is SemanticTokens;
93 }
94 /**
95  * @since 3.16.0
96  */
97 export interface SemanticTokensPartialResult {
98     data: uinteger[];
99 }
100 /**
101  * @since 3.16.0
102  */
103 export interface SemanticTokensEdit {
104     /**
105      * The start offset of the edit.
106      */
107     start: uinteger;
108     /**
109      * The count of elements to remove.
110      */
111     deleteCount: uinteger;
112     /**
113      * The elements to insert.
114      */
115     data?: uinteger[];
116 }
117 /**
118  * @since 3.16.0
119  */
120 export interface SemanticTokensDelta {
121     readonly resultId?: string;
122     /**
123      * The semantic token edits to transform a previous result into a new result.
124      */
125     edits: SemanticTokensEdit[];
126 }
127 /**
128  * @since 3.16.0
129  */
130 export interface SemanticTokensDeltaPartialResult {
131     edits: SemanticTokensEdit[];
132 }
133 export declare namespace TokenFormat {
134     const Relative: 'relative';
135 }
136 export declare type TokenFormat = 'relative';
137 /**
138  * @since 3.16.0
139  */
140 export interface SemanticTokensClientCapabilities {
141     /**
142      * Whether implementation supports dynamic registration. If this is set to `true`
143      * the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
144      * return value for the corresponding server capability as well.
145      */
146     dynamicRegistration?: boolean;
147     /**
148      * Which requests the client supports and might send to the server
149      * depending on the server's capability. Please note that clients might not
150      * show semantic tokens or degrade some of the user experience if a range
151      * or full request is advertised by the client but not provided by the
152      * server. If for example the client capability `requests.full` and
153      * `request.range` are both set to true but the server only provides a
154      * range provider the client might not render a minimap correctly or might
155      * even decide to not show any semantic tokens at all.
156      */
157     requests: {
158         /**
159          * The client will send the `textDocument/semanticTokens/range` request if
160          * the server provides a corresponding handler.
161          */
162         range?: boolean | {};
163         /**
164          * The client will send the `textDocument/semanticTokens/full` request if
165          * the server provides a corresponding handler.
166          */
167         full?: boolean | {
168             /**
169              * The client will send the `textDocument/semanticTokens/full/delta` request if
170              * the server provides a corresponding handler.
171              */
172             delta?: boolean;
173         };
174     };
175     /**
176      * The token types that the client supports.
177      */
178     tokenTypes: string[];
179     /**
180      * The token modifiers that the client supports.
181      */
182     tokenModifiers: string[];
183     /**
184      * The token formats the clients supports.
185      */
186     formats: TokenFormat[];
187     /**
188      * Whether the client supports tokens that can overlap each other.
189      */
190     overlappingTokenSupport?: boolean;
191     /**
192      * Whether the client supports tokens that can span multiple lines.
193      */
194     multilineTokenSupport?: boolean;
195 }
196 /**
197  * @since 3.16.0
198  */
199 export interface SemanticTokensOptions extends WorkDoneProgressOptions {
200     /**
201      * The legend used by the server
202      */
203     legend: SemanticTokensLegend;
204     /**
205      * Server supports providing semantic tokens for a specific range
206      * of a document.
207      */
208     range?: boolean | {};
209     /**
210      * Server supports providing semantic tokens for a full document.
211      */
212     full?: boolean | {
213         /**
214          * The server supports deltas for full documents.
215          */
216         delta?: boolean;
217     };
218 }
219 /**
220  * @since 3.16.0
221  */
222 export interface SemanticTokensRegistrationOptions extends TextDocumentRegistrationOptions, SemanticTokensOptions, StaticRegistrationOptions {
223 }
224 export declare namespace SemanticTokensRegistrationType {
225     const method: 'textDocument/semanticTokens';
226     const type: RegistrationType<SemanticTokensRegistrationOptions>;
227 }
228 /**
229  * @since 3.16.0
230  */
231 export interface SemanticTokensParams extends WorkDoneProgressParams, PartialResultParams {
232     /**
233      * The text document.
234      */
235     textDocument: TextDocumentIdentifier;
236 }
237 /**
238  * @since 3.16.0
239  */
240 export declare namespace SemanticTokensRequest {
241     const method: 'textDocument/semanticTokens/full';
242     const type: ProtocolRequestType<SemanticTokensParams, SemanticTokens | null, SemanticTokensPartialResult, void, SemanticTokensRegistrationOptions>;
243     type HandlerSignature = RequestHandler<SemanticTokensDeltaParams, SemanticTokens | null, void>;
244 }
245 /**
246  * @since 3.16.0
247  */
248 export interface SemanticTokensDeltaParams extends WorkDoneProgressParams, PartialResultParams {
249     /**
250      * The text document.
251      */
252     textDocument: TextDocumentIdentifier;
253     /**
254      * The result id of a previous response. The result Id can either point to a full response
255      * or a delta response depending on what was received last.
256      */
257     previousResultId: string;
258 }
259 /**
260  * @since 3.16.0
261  */
262 export declare namespace SemanticTokensDeltaRequest {
263     const method: 'textDocument/semanticTokens/full/delta';
264     const type: ProtocolRequestType<SemanticTokensDeltaParams, SemanticTokens | SemanticTokensDelta | null, SemanticTokensPartialResult | SemanticTokensDeltaPartialResult, void, SemanticTokensRegistrationOptions>;
265     type HandlerSignature = RequestHandler<SemanticTokensDeltaParams, SemanticTokens | SemanticTokensDelta | null, void>;
266 }
267 /**
268  * @since 3.16.0
269  */
270 export interface SemanticTokensRangeParams extends WorkDoneProgressParams, PartialResultParams {
271     /**
272      * The text document.
273      */
274     textDocument: TextDocumentIdentifier;
275     /**
276      * The range the semantic tokens are requested for.
277      */
278     range: Range;
279 }
280 /**
281  * @since 3.16.0
282  */
283 export declare namespace SemanticTokensRangeRequest {
284     const method: 'textDocument/semanticTokens/range';
285     const type: ProtocolRequestType<SemanticTokensRangeParams, SemanticTokens | null, SemanticTokensPartialResult, void, void>;
286     type HandlerSignature = RequestHandler<SemanticTokensRangeParams, SemanticTokens | null, void>;
287 }
288 export interface SemanticTokensWorkspaceClientCapabilities {
289     /**
290      * Whether the client implementation supports a refresh request sent from
291      * the server to the client.
292      *
293      * Note that this event is global and will force the client to refresh all
294      * semantic tokens currently shown. It should be used with absolute care
295      * and is useful for situation where a server for example detect a project
296      * wide change that requires such a calculation.
297      */
298     refreshSupport?: boolean;
299 }
300 /**
301  * @since 3.16.0
302  */
303 export declare namespace SemanticTokensRefreshRequest {
304     const method: `workspace/semanticTokens/refresh`;
305     const type: ProtocolRequestType0<void, void, void, void>;
306     type HandlerSignature = RequestHandler0<void, void>;
307 }