@codingame/monaco-vscode-textmate-service-override 9.0.0 → 9.0.2
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.
- package/package.json +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.js +2 -2
- package/vscode/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.js +11 -11
- package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +24 -24
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-textmate-service-override",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"vscode": "npm:@codingame/monaco-vscode-api@9.0.
|
|
32
|
+
"vscode": "npm:@codingame/monaco-vscode-api@9.0.2",
|
|
33
33
|
"vscode-oniguruma": "1.7.0",
|
|
34
34
|
"vscode-textmate": "9.1.0",
|
|
35
|
-
"@codingame/monaco-vscode-files-service-override": "9.0.
|
|
35
|
+
"@codingame/monaco-vscode-files-service-override": "9.0.2"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -100,7 +100,7 @@ class InspectEditorTokens extends EditorAction {
|
|
|
100
100
|
constructor() {
|
|
101
101
|
super({
|
|
102
102
|
id: 'editor.action.inspectTMScopes',
|
|
103
|
-
label: ( localize(
|
|
103
|
+
label: ( localize(2806, "Developer: Inspect Editor Tokens and Scopes")),
|
|
104
104
|
alias: 'Developer: Inspect Editor Tokens and Scopes',
|
|
105
105
|
precondition: undefined
|
|
106
106
|
});
|
|
@@ -168,7 +168,7 @@ class InspectEditorTokensWidget extends Disposable {
|
|
|
168
168
|
const semanticTokens = this._computeSemanticTokens(position);
|
|
169
169
|
const tree = this._treeSitterService.getParseResult(this._model);
|
|
170
170
|
clearNode(this._domNode);
|
|
171
|
-
this._domNode.appendChild(document.createTextNode(( localize(
|
|
171
|
+
this._domNode.appendChild(document.createTextNode(( localize(2807, "Loading..."))));
|
|
172
172
|
Promise.all([grammar, semanticTokens]).then(([grammar, semanticTokens]) => {
|
|
173
173
|
if (this._isDisposed) {
|
|
174
174
|
return;
|
package/vscode/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.js
CHANGED
|
@@ -169,7 +169,7 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
|
|
|
169
169
|
}
|
|
170
170
|
startDebugMode(printFn, onStop) {
|
|
171
171
|
if (this._debugMode) {
|
|
172
|
-
this._notificationService.error(( localize(
|
|
172
|
+
this._notificationService.error(( localize(2771, "Already Logging.")));
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
175
|
this._debugModePrintFunc = printFn;
|
|
@@ -177,15 +177,15 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
|
|
|
177
177
|
if (this._debugMode) {
|
|
178
178
|
this._progressService.withProgress({
|
|
179
179
|
location: ProgressLocation.Notification,
|
|
180
|
-
buttons: [( localize(
|
|
180
|
+
buttons: [( localize(2772, "Stop"))]
|
|
181
181
|
}, (progress) => {
|
|
182
182
|
progress.report({
|
|
183
|
-
message: ( localize(
|
|
183
|
+
message: ( localize(2773, "Preparing to log TM Grammar parsing. Press Stop when finished."))
|
|
184
184
|
});
|
|
185
185
|
return this._getVSCodeOniguruma().then((vscodeOniguruma) => {
|
|
186
186
|
vscodeOniguruma.setDefaultDebugCall(true);
|
|
187
187
|
progress.report({
|
|
188
|
-
message: ( localize(
|
|
188
|
+
message: ( localize(2774, "Now logging TM Grammar parsing. Press Stop when finished."))
|
|
189
189
|
});
|
|
190
190
|
return (
|
|
191
191
|
(new Promise((resolve, reject) => { }))
|
|
@@ -393,7 +393,7 @@ function equalsTokenRules(a, b) {
|
|
|
393
393
|
function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _languageService) {
|
|
394
394
|
if (syntax.language && ((typeof syntax.language !== 'string') || !_languageService.isRegisteredLanguageId(syntax.language))) {
|
|
395
395
|
collector.error(( localize(
|
|
396
|
-
|
|
396
|
+
2775,
|
|
397
397
|
"Unknown language in `contributes.{0}.language`. Provided value: {1}",
|
|
398
398
|
grammarsExtPoint.name,
|
|
399
399
|
String(syntax.language)
|
|
@@ -402,7 +402,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
402
402
|
}
|
|
403
403
|
if (!syntax.scopeName || (typeof syntax.scopeName !== 'string')) {
|
|
404
404
|
collector.error(( localize(
|
|
405
|
-
|
|
405
|
+
2776,
|
|
406
406
|
"Expected string in `contributes.{0}.scopeName`. Provided value: {1}",
|
|
407
407
|
grammarsExtPoint.name,
|
|
408
408
|
String(syntax.scopeName)
|
|
@@ -411,7 +411,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
411
411
|
}
|
|
412
412
|
if (!syntax.path || (typeof syntax.path !== 'string')) {
|
|
413
413
|
collector.error(( localize(
|
|
414
|
-
|
|
414
|
+
2777,
|
|
415
415
|
"Expected string in `contributes.{0}.path`. Provided value: {1}",
|
|
416
416
|
grammarsExtPoint.name,
|
|
417
417
|
String(syntax.path)
|
|
@@ -420,7 +420,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
420
420
|
}
|
|
421
421
|
if (syntax.injectTo && (!Array.isArray(syntax.injectTo) || ( (syntax.injectTo.some(scope => typeof scope !== 'string'))))) {
|
|
422
422
|
collector.error(( localize(
|
|
423
|
-
|
|
423
|
+
2778,
|
|
424
424
|
"Invalid value in `contributes.{0}.injectTo`. Must be an array of language scope names. Provided value: {1}",
|
|
425
425
|
grammarsExtPoint.name,
|
|
426
426
|
JSON.stringify(syntax.injectTo)
|
|
@@ -429,7 +429,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
429
429
|
}
|
|
430
430
|
if (syntax.embeddedLanguages && !isObject(syntax.embeddedLanguages)) {
|
|
431
431
|
collector.error(( localize(
|
|
432
|
-
|
|
432
|
+
2779,
|
|
433
433
|
"Invalid value in `contributes.{0}.embeddedLanguages`. Must be an object map from scope name to language. Provided value: {1}",
|
|
434
434
|
grammarsExtPoint.name,
|
|
435
435
|
JSON.stringify(syntax.embeddedLanguages)
|
|
@@ -438,7 +438,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
438
438
|
}
|
|
439
439
|
if (syntax.tokenTypes && !isObject(syntax.tokenTypes)) {
|
|
440
440
|
collector.error(( localize(
|
|
441
|
-
|
|
441
|
+
2780,
|
|
442
442
|
"Invalid value in `contributes.{0}.tokenTypes`. Must be an object map from scope name to token type. Provided value: {1}",
|
|
443
443
|
grammarsExtPoint.name,
|
|
444
444
|
JSON.stringify(syntax.tokenTypes)
|
|
@@ -448,7 +448,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
448
448
|
const grammarLocation = joinPath(extensionLocation, syntax.path);
|
|
449
449
|
if (!isEqualOrParent(grammarLocation, extensionLocation)) {
|
|
450
450
|
collector.warn(( localize(
|
|
451
|
-
|
|
451
|
+
2781,
|
|
452
452
|
"Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",
|
|
453
453
|
grammarsExtPoint.name,
|
|
454
454
|
grammarLocation.path,
|
|
@@ -9,26 +9,26 @@ const tokenClassificationRegistry = getTokenClassificationRegistry();
|
|
|
9
9
|
const tokenTypeExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
10
10
|
extensionPoint: 'semanticTokenTypes',
|
|
11
11
|
jsonSchema: {
|
|
12
|
-
description: ( localize(
|
|
12
|
+
description: ( localize(2782, 'Contributes semantic token types.')),
|
|
13
13
|
type: 'array',
|
|
14
14
|
items: {
|
|
15
15
|
type: 'object',
|
|
16
16
|
properties: {
|
|
17
17
|
id: {
|
|
18
18
|
type: 'string',
|
|
19
|
-
description: ( localize(
|
|
19
|
+
description: ( localize(2783, 'The identifier of the semantic token type')),
|
|
20
20
|
pattern: typeAndModifierIdPattern,
|
|
21
|
-
patternErrorMessage: ( localize(
|
|
21
|
+
patternErrorMessage: ( localize(2784, 'Identifiers should be in the form letterOrDigit[_-letterOrDigit]*')),
|
|
22
22
|
},
|
|
23
23
|
superType: {
|
|
24
24
|
type: 'string',
|
|
25
|
-
description: ( localize(
|
|
25
|
+
description: ( localize(2785, 'The super type of the semantic token type')),
|
|
26
26
|
pattern: typeAndModifierIdPattern,
|
|
27
|
-
patternErrorMessage: ( localize(
|
|
27
|
+
patternErrorMessage: ( localize(2786, 'Super types should be in the form letterOrDigit[_-letterOrDigit]*')),
|
|
28
28
|
},
|
|
29
29
|
description: {
|
|
30
30
|
type: 'string',
|
|
31
|
-
description: ( localize(
|
|
31
|
+
description: ( localize(2787, 'The description of the semantic token type')),
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -37,20 +37,20 @@ const tokenTypeExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
|
37
37
|
const tokenModifierExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
38
38
|
extensionPoint: 'semanticTokenModifiers',
|
|
39
39
|
jsonSchema: {
|
|
40
|
-
description: ( localize(
|
|
40
|
+
description: ( localize(2788, 'Contributes semantic token modifiers.')),
|
|
41
41
|
type: 'array',
|
|
42
42
|
items: {
|
|
43
43
|
type: 'object',
|
|
44
44
|
properties: {
|
|
45
45
|
id: {
|
|
46
46
|
type: 'string',
|
|
47
|
-
description: ( localize(
|
|
47
|
+
description: ( localize(2789, 'The identifier of the semantic token modifier')),
|
|
48
48
|
pattern: typeAndModifierIdPattern,
|
|
49
|
-
patternErrorMessage: ( localize(
|
|
49
|
+
patternErrorMessage: ( localize(2790, 'Identifiers should be in the form letterOrDigit[_-letterOrDigit]*'))
|
|
50
50
|
},
|
|
51
51
|
description: {
|
|
52
52
|
type: 'string',
|
|
53
|
-
description: ( localize(
|
|
53
|
+
description: ( localize(2791, 'The description of the semantic token modifier'))
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -59,18 +59,18 @@ const tokenModifierExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
|
59
59
|
const tokenStyleDefaultsExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
60
60
|
extensionPoint: 'semanticTokenScopes',
|
|
61
61
|
jsonSchema: {
|
|
62
|
-
description: ( localize(
|
|
62
|
+
description: ( localize(2792, 'Contributes semantic token scope maps.')),
|
|
63
63
|
type: 'array',
|
|
64
64
|
items: {
|
|
65
65
|
type: 'object',
|
|
66
66
|
properties: {
|
|
67
67
|
language: {
|
|
68
|
-
description: ( localize(
|
|
68
|
+
description: ( localize(2793, 'Lists the languge for which the defaults are.')),
|
|
69
69
|
type: 'string'
|
|
70
70
|
},
|
|
71
71
|
scopes: {
|
|
72
72
|
description: ( localize(
|
|
73
|
-
|
|
73
|
+
2794,
|
|
74
74
|
'Maps a semantic token (described by semantic token selector) to one or more textMate scopes used to represent that token.'
|
|
75
75
|
)),
|
|
76
76
|
type: 'object',
|
|
@@ -90,7 +90,7 @@ class TokenClassificationExtensionPoints {
|
|
|
90
90
|
function validateTypeOrModifier(contribution, extensionPoint, collector) {
|
|
91
91
|
if (typeof contribution.id !== 'string' || contribution.id.length === 0) {
|
|
92
92
|
collector.error(( localize(
|
|
93
|
-
|
|
93
|
+
2795,
|
|
94
94
|
"'configuration.{0}.id' must be defined and can not be empty",
|
|
95
95
|
extensionPoint
|
|
96
96
|
)));
|
|
@@ -98,7 +98,7 @@ class TokenClassificationExtensionPoints {
|
|
|
98
98
|
}
|
|
99
99
|
if (!contribution.id.match(typeAndModifierIdPattern)) {
|
|
100
100
|
collector.error(( localize(
|
|
101
|
-
|
|
101
|
+
2796,
|
|
102
102
|
"'configuration.{0}.id' must follow the pattern letterOrDigit[-_letterOrDigit]*",
|
|
103
103
|
extensionPoint
|
|
104
104
|
)));
|
|
@@ -107,7 +107,7 @@ class TokenClassificationExtensionPoints {
|
|
|
107
107
|
const superType = contribution.superType;
|
|
108
108
|
if (superType && !superType.match(typeAndModifierIdPattern)) {
|
|
109
109
|
collector.error(( localize(
|
|
110
|
-
|
|
110
|
+
2797,
|
|
111
111
|
"'configuration.{0}.superType' must follow the pattern letterOrDigit[-_letterOrDigit]*",
|
|
112
112
|
extensionPoint
|
|
113
113
|
)));
|
|
@@ -115,7 +115,7 @@ class TokenClassificationExtensionPoints {
|
|
|
115
115
|
}
|
|
116
116
|
if (typeof contribution.description !== 'string' || contribution.id.length === 0) {
|
|
117
117
|
collector.error(( localize(
|
|
118
|
-
|
|
118
|
+
2798,
|
|
119
119
|
"'configuration.{0}.description' must be defined and can not be empty",
|
|
120
120
|
extensionPoint
|
|
121
121
|
)));
|
|
@@ -128,7 +128,7 @@ class TokenClassificationExtensionPoints {
|
|
|
128
128
|
const extensionValue = extension.value;
|
|
129
129
|
const collector = extension.collector;
|
|
130
130
|
if (!extensionValue || !Array.isArray(extensionValue)) {
|
|
131
|
-
collector.error(( localize(
|
|
131
|
+
collector.error(( localize(2799, "'configuration.semanticTokenType' must be an array")));
|
|
132
132
|
return;
|
|
133
133
|
}
|
|
134
134
|
for (const contribution of extensionValue) {
|
|
@@ -149,7 +149,7 @@ class TokenClassificationExtensionPoints {
|
|
|
149
149
|
const extensionValue = extension.value;
|
|
150
150
|
const collector = extension.collector;
|
|
151
151
|
if (!extensionValue || !Array.isArray(extensionValue)) {
|
|
152
|
-
collector.error(( localize(
|
|
152
|
+
collector.error(( localize(2800, "'configuration.semanticTokenModifier' must be an array")));
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
for (const contribution of extensionValue) {
|
|
@@ -170,17 +170,17 @@ class TokenClassificationExtensionPoints {
|
|
|
170
170
|
const extensionValue = extension.value;
|
|
171
171
|
const collector = extension.collector;
|
|
172
172
|
if (!extensionValue || !Array.isArray(extensionValue)) {
|
|
173
|
-
collector.error(( localize(
|
|
173
|
+
collector.error(( localize(2801, "'configuration.semanticTokenScopes' must be an array")));
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
176
|
for (const contribution of extensionValue) {
|
|
177
177
|
if (contribution.language && typeof contribution.language !== 'string') {
|
|
178
|
-
collector.error(( localize(
|
|
178
|
+
collector.error(( localize(2802, "'configuration.semanticTokenScopes.language' must be a string")));
|
|
179
179
|
continue;
|
|
180
180
|
}
|
|
181
181
|
if (!contribution.scopes || typeof contribution.scopes !== 'object') {
|
|
182
182
|
collector.error(( localize(
|
|
183
|
-
|
|
183
|
+
2803,
|
|
184
184
|
"'configuration.semanticTokenScopes.scopes' must be defined as an object"
|
|
185
185
|
)));
|
|
186
186
|
continue;
|
|
@@ -189,7 +189,7 @@ class TokenClassificationExtensionPoints {
|
|
|
189
189
|
const tmScopes = contribution.scopes[selectorString];
|
|
190
190
|
if (!Array.isArray(tmScopes) || ( (tmScopes.some(l => typeof l !== 'string')))) {
|
|
191
191
|
collector.error(( localize(
|
|
192
|
-
|
|
192
|
+
2804,
|
|
193
193
|
"'configuration.semanticTokenScopes.scopes' values must be an array of strings"
|
|
194
194
|
)));
|
|
195
195
|
continue;
|
|
@@ -200,7 +200,7 @@ class TokenClassificationExtensionPoints {
|
|
|
200
200
|
}
|
|
201
201
|
catch (e) {
|
|
202
202
|
collector.error(( localize(
|
|
203
|
-
|
|
203
|
+
2805,
|
|
204
204
|
"configuration.semanticTokenScopes.scopes': Problems parsing selector {0}.",
|
|
205
205
|
selectorString
|
|
206
206
|
)));
|