@codingame/monaco-vscode-textmate-service-override 8.0.2 → 8.0.3
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": "8.0.
|
|
3
|
+
"version": "8.0.3",
|
|
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@8.0.
|
|
32
|
+
"vscode": "npm:@codingame/monaco-vscode-api@8.0.3",
|
|
33
33
|
"vscode-oniguruma": "1.7.0",
|
|
34
34
|
"vscode-textmate": "9.0.0",
|
|
35
|
-
"@codingame/monaco-vscode-files-service-override": "8.0.
|
|
35
|
+
"@codingame/monaco-vscode-files-service-override": "8.0.3"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -95,7 +95,7 @@ class InspectEditorTokens extends EditorAction {
|
|
|
95
95
|
constructor() {
|
|
96
96
|
super({
|
|
97
97
|
id: 'editor.action.inspectTMScopes',
|
|
98
|
-
label: ( localize(
|
|
98
|
+
label: ( localize(2805, "Developer: Inspect Editor Tokens and Scopes")),
|
|
99
99
|
alias: 'Developer: Inspect Editor Tokens and Scopes',
|
|
100
100
|
precondition: undefined
|
|
101
101
|
});
|
|
@@ -161,7 +161,7 @@ class InspectEditorTokensWidget extends Disposable {
|
|
|
161
161
|
const grammar = this._textMateService.createTokenizer(this._model.getLanguageId());
|
|
162
162
|
const semanticTokens = this._computeSemanticTokens(position);
|
|
163
163
|
clearNode(this._domNode);
|
|
164
|
-
this._domNode.appendChild(document.createTextNode(( localize(
|
|
164
|
+
this._domNode.appendChild(document.createTextNode(( localize(2806, "Loading..."))));
|
|
165
165
|
Promise.all([grammar, semanticTokens]).then(([grammar, semanticTokens]) => {
|
|
166
166
|
if (this._isDisposed) {
|
|
167
167
|
return;
|
package/vscode/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.js
CHANGED
|
@@ -167,7 +167,7 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
|
|
|
167
167
|
}
|
|
168
168
|
startDebugMode(printFn, onStop) {
|
|
169
169
|
if (this._debugMode) {
|
|
170
|
-
this._notificationService.error(( localize(
|
|
170
|
+
this._notificationService.error(( localize(2770, "Already Logging.")));
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
173
|
this._debugModePrintFunc = printFn;
|
|
@@ -175,15 +175,15 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
|
|
|
175
175
|
if (this._debugMode) {
|
|
176
176
|
this._progressService.withProgress({
|
|
177
177
|
location: ProgressLocation.Notification,
|
|
178
|
-
buttons: [( localize(
|
|
178
|
+
buttons: [( localize(2771, "Stop"))]
|
|
179
179
|
}, (progress) => {
|
|
180
180
|
progress.report({
|
|
181
|
-
message: ( localize(
|
|
181
|
+
message: ( localize(2772, "Preparing to log TM Grammar parsing. Press Stop when finished."))
|
|
182
182
|
});
|
|
183
183
|
return this._getVSCodeOniguruma().then((vscodeOniguruma) => {
|
|
184
184
|
vscodeOniguruma.setDefaultDebugCall(true);
|
|
185
185
|
progress.report({
|
|
186
|
-
message: ( localize(
|
|
186
|
+
message: ( localize(2773, "Now logging TM Grammar parsing. Press Stop when finished."))
|
|
187
187
|
});
|
|
188
188
|
return (
|
|
189
189
|
(new Promise((resolve, reject) => { }))
|
|
@@ -392,7 +392,7 @@ function equalsTokenRules(a, b) {
|
|
|
392
392
|
function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _languageService) {
|
|
393
393
|
if (syntax.language && ((typeof syntax.language !== 'string') || !_languageService.isRegisteredLanguageId(syntax.language))) {
|
|
394
394
|
collector.error(( localize(
|
|
395
|
-
|
|
395
|
+
2774,
|
|
396
396
|
"Unknown language in `contributes.{0}.language`. Provided value: {1}",
|
|
397
397
|
grammarsExtPoint.name,
|
|
398
398
|
String(syntax.language)
|
|
@@ -401,7 +401,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
401
401
|
}
|
|
402
402
|
if (!syntax.scopeName || (typeof syntax.scopeName !== 'string')) {
|
|
403
403
|
collector.error(( localize(
|
|
404
|
-
|
|
404
|
+
2775,
|
|
405
405
|
"Expected string in `contributes.{0}.scopeName`. Provided value: {1}",
|
|
406
406
|
grammarsExtPoint.name,
|
|
407
407
|
String(syntax.scopeName)
|
|
@@ -410,7 +410,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
410
410
|
}
|
|
411
411
|
if (!syntax.path || (typeof syntax.path !== 'string')) {
|
|
412
412
|
collector.error(( localize(
|
|
413
|
-
|
|
413
|
+
2776,
|
|
414
414
|
"Expected string in `contributes.{0}.path`. Provided value: {1}",
|
|
415
415
|
grammarsExtPoint.name,
|
|
416
416
|
String(syntax.path)
|
|
@@ -419,7 +419,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
419
419
|
}
|
|
420
420
|
if (syntax.injectTo && (!Array.isArray(syntax.injectTo) || ( (syntax.injectTo.some(scope => typeof scope !== 'string'))))) {
|
|
421
421
|
collector.error(( localize(
|
|
422
|
-
|
|
422
|
+
2777,
|
|
423
423
|
"Invalid value in `contributes.{0}.injectTo`. Must be an array of language scope names. Provided value: {1}",
|
|
424
424
|
grammarsExtPoint.name,
|
|
425
425
|
JSON.stringify(syntax.injectTo)
|
|
@@ -428,7 +428,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
428
428
|
}
|
|
429
429
|
if (syntax.embeddedLanguages && !isObject(syntax.embeddedLanguages)) {
|
|
430
430
|
collector.error(( localize(
|
|
431
|
-
|
|
431
|
+
2778,
|
|
432
432
|
"Invalid value in `contributes.{0}.embeddedLanguages`. Must be an object map from scope name to language. Provided value: {1}",
|
|
433
433
|
grammarsExtPoint.name,
|
|
434
434
|
JSON.stringify(syntax.embeddedLanguages)
|
|
@@ -437,7 +437,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
437
437
|
}
|
|
438
438
|
if (syntax.tokenTypes && !isObject(syntax.tokenTypes)) {
|
|
439
439
|
collector.error(( localize(
|
|
440
|
-
|
|
440
|
+
2779,
|
|
441
441
|
"Invalid value in `contributes.{0}.tokenTypes`. Must be an object map from scope name to token type. Provided value: {1}",
|
|
442
442
|
grammarsExtPoint.name,
|
|
443
443
|
JSON.stringify(syntax.tokenTypes)
|
|
@@ -447,7 +447,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
447
447
|
const grammarLocation = joinPath(extensionLocation, syntax.path);
|
|
448
448
|
if (!isEqualOrParent(grammarLocation, extensionLocation)) {
|
|
449
449
|
collector.warn(( localize(
|
|
450
|
-
|
|
450
|
+
2780,
|
|
451
451
|
"Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",
|
|
452
452
|
grammarsExtPoint.name,
|
|
453
453
|
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(2781, '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(2782, 'The identifier of the semantic token type')),
|
|
20
20
|
pattern: typeAndModifierIdPattern,
|
|
21
|
-
patternErrorMessage: ( localize(
|
|
21
|
+
patternErrorMessage: ( localize(2783, 'Identifiers should be in the form letterOrDigit[_-letterOrDigit]*')),
|
|
22
22
|
},
|
|
23
23
|
superType: {
|
|
24
24
|
type: 'string',
|
|
25
|
-
description: ( localize(
|
|
25
|
+
description: ( localize(2784, 'The super type of the semantic token type')),
|
|
26
26
|
pattern: typeAndModifierIdPattern,
|
|
27
|
-
patternErrorMessage: ( localize(
|
|
27
|
+
patternErrorMessage: ( localize(2785, 'Super types should be in the form letterOrDigit[_-letterOrDigit]*')),
|
|
28
28
|
},
|
|
29
29
|
description: {
|
|
30
30
|
type: 'string',
|
|
31
|
-
description: ( localize(
|
|
31
|
+
description: ( localize(2786, '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(2787, '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(2788, 'The identifier of the semantic token modifier')),
|
|
48
48
|
pattern: typeAndModifierIdPattern,
|
|
49
|
-
patternErrorMessage: ( localize(
|
|
49
|
+
patternErrorMessage: ( localize(2789, 'Identifiers should be in the form letterOrDigit[_-letterOrDigit]*'))
|
|
50
50
|
},
|
|
51
51
|
description: {
|
|
52
52
|
type: 'string',
|
|
53
|
-
description: ( localize(
|
|
53
|
+
description: ( localize(2790, '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(2791, '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(2792, 'Lists the languge for which the defaults are.')),
|
|
69
69
|
type: 'string'
|
|
70
70
|
},
|
|
71
71
|
scopes: {
|
|
72
72
|
description: ( localize(
|
|
73
|
-
|
|
73
|
+
2793,
|
|
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
|
+
2794,
|
|
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
|
+
2795,
|
|
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
|
+
2796,
|
|
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
|
+
2797,
|
|
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(2798, "'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(2799, "'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(2800, "'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(2801, "'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
|
+
2802,
|
|
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
|
+
2803,
|
|
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
|
+
2804,
|
|
204
204
|
"configuration.semanticTokenScopes.scopes': Problems parsing selector {0}.",
|
|
205
205
|
selectorString
|
|
206
206
|
)));
|