@ktjs/ts-plugin 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,9 +6,7 @@ const jsx_attributes_1 = require("./jsx-attributes");
|
|
|
6
6
|
const kfor_parser_1 = require("./kfor-parser");
|
|
7
7
|
const identifiers_1 = require("./identifiers");
|
|
8
8
|
const TOKEN_TYPE_VARIABLE = 7;
|
|
9
|
-
const TOKEN_TYPE_TYPE = 5;
|
|
10
9
|
const TOKEN_MODIFIER_READONLY = 1 << 3;
|
|
11
|
-
const TOKEN_MODIFIER_LOCAL = 1 << 5;
|
|
12
10
|
const TOKEN_ENCODING_TYPE_OFFSET = 8;
|
|
13
11
|
const IDENTIFIER_PATTERN = /[A-Za-z_$][A-Za-z0-9_$]*/g;
|
|
14
12
|
const KEYWORD_DELIMITER_PATTERN = /\s+(in|of)\s+/;
|
|
@@ -237,11 +235,9 @@ function buildSemanticSpans(tokens, format, ts) {
|
|
|
237
235
|
spans.push({
|
|
238
236
|
start: token.start,
|
|
239
237
|
length: token.length,
|
|
240
|
-
classification: token.kind === '
|
|
241
|
-
? encodeSemantic2020(TOKEN_TYPE_VARIABLE, TOKEN_MODIFIER_READONLY
|
|
242
|
-
:
|
|
243
|
-
? encodeSemantic2020(TOKEN_TYPE_TYPE, 0)
|
|
244
|
-
: encodeSemantic2020(TOKEN_TYPE_VARIABLE, 0),
|
|
238
|
+
classification: token.kind === 'keyword'
|
|
239
|
+
? encodeSemantic2020(TOKEN_TYPE_VARIABLE, TOKEN_MODIFIER_READONLY)
|
|
240
|
+
: encodeSemantic2020(TOKEN_TYPE_VARIABLE, 0),
|
|
245
241
|
});
|
|
246
242
|
}
|
|
247
243
|
return spans;
|