forked from microsoft/vscode-languageserver-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprotocol.semanticHighlighting.proposed.ts
90 lines (71 loc) · 2.58 KB
/
protocol.semanticHighlighting.proposed.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* --------------------------------------------------------------------------------------------
* Copyright (c) TypeFox. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
import { NotificationType } from 'vscode-jsonrpc';
/**
* Parameters for the semantic highlighting (server-side) push notification.
*/
export interface SemanticHighlightingParams {
/**
* The URI for which semantic highlighting information is reported to.
*/
uri: string;
/**
* An array of semantic highlighting information.
*/
lines: SemanticHighlightingInformation[];
}
/**
* Represents a semantic highlighting information that has to be applied on a specific line of the text document.
*/
export interface SemanticHighlightingInformation {
/**
* The zero-based line position in the text document.
*/
line: number;
/**
* An array of highlighting tokens for the current line in the text document.
*/
tokens: SemanticHighlightingToken[];
}
/**
* Representation of a single semantic highlighting token that has to be applied on a line of the text document.
*/
export interface SemanticHighlightingToken {
/**
* The zero-based character offset on the line in a text document where this token applies. If negative, defaults to `0`.
* If greater than the length of the current line, defaults to the end of the line.
*/
character: number;
/**
* The length of the token. If negative, defaults to `0`. If the sum of the `character` and the `length` exceeds the length of the line,
* it defaults back to the end of the line.
*/
length: number;
/**
* An array of semantic highlighting [TextMate scopes](https://manual.macromates.com/en/language_grammars) for the current token.
*/
scopes: string[];
}
/**
* Language server push notification providing the semantic highlighting information for a text document.
*/
export namespace SemanticHighlightingNotification {
export const type = new NotificationType<SemanticHighlightingParams, void>('textDocument/semanticHighlighting');
}
/**
* Capability that has to be set by the language client if that supports the semantic highlighting feature for the text documents.
*/
export interface SemanticHighlightingClientCapabilities {
/**
* The text document client capabilities.
*/
textDocument?: {
/**
* `true` if the client supports semantic highlighting support text documents. Otherwise, `false`. It is `false` by default.
*/
semanticHighlighting?: boolean;
}
}