@codingame/monaco-vscode-textmate-service-override 10.1.4 → 11.0.1
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/services/textMate/browser/backgroundTokenization/threadedBackgroundTokenizerFactory.js +1 -0
- package/vscode/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.js +13 -14
- package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +24 -24
- package/workers/textmate.worker.js +1 -1
- package/vscode/src/vs/amdX.js +0 -17
- /package/vscode/src/vs/workbench/services/textMate/browser/backgroundTokenization/worker/{textMateTokenizationWorker.worker.esm.js → textMateTokenizationWorker.workerMain.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-textmate-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.1",
|
|
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@
|
|
32
|
+
"vscode": "npm:@codingame/monaco-vscode-api@11.0.1",
|
|
33
33
|
"vscode-oniguruma": "1.7.0",
|
|
34
34
|
"vscode-textmate": "9.1.0",
|
|
35
|
-
"@codingame/monaco-vscode-files-service-override": "
|
|
35
|
+
"@codingame/monaco-vscode-files-service-override": "11.0.1"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
+
import 'vscode/vscode/vs/amdX';
|
|
2
3
|
import { DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
4
|
import { nodeModulesPath, FileAccess } from 'vscode/vscode/vs/base/common/network';
|
|
4
5
|
import 'vscode/vscode/vs/base/common/platform';
|
package/vscode/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import { resolveAmdNodeModulePath } from '
|
|
2
|
+
import { resolveAmdNodeModulePath } from 'vscode/vscode/vs/amdX';
|
|
3
3
|
import { createStyleSheet } from 'vscode/vscode/vs/base/browser/dom';
|
|
4
4
|
import { equals } from 'vscode/vscode/vs/base/common/arrays';
|
|
5
5
|
import { Color } from 'vscode/vscode/vs/base/common/color';
|
|
@@ -165,7 +165,7 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
|
|
|
165
165
|
}
|
|
166
166
|
startDebugMode(printFn, onStop) {
|
|
167
167
|
if (this._debugMode) {
|
|
168
|
-
this._notificationService.error(( localize(
|
|
168
|
+
this._notificationService.error(( localize(3140, "Already Logging.")));
|
|
169
169
|
return;
|
|
170
170
|
}
|
|
171
171
|
this._debugModePrintFunc = printFn;
|
|
@@ -173,15 +173,15 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
|
|
|
173
173
|
if (this._debugMode) {
|
|
174
174
|
this._progressService.withProgress({
|
|
175
175
|
location: 15 ,
|
|
176
|
-
buttons: [( localize(
|
|
176
|
+
buttons: [( localize(3141, "Stop"))]
|
|
177
177
|
}, (progress) => {
|
|
178
178
|
progress.report({
|
|
179
|
-
message: ( localize(
|
|
179
|
+
message: ( localize(3142, "Preparing to log TM Grammar parsing. Press Stop when finished."))
|
|
180
180
|
});
|
|
181
181
|
return this._getVSCodeOniguruma().then((vscodeOniguruma) => {
|
|
182
182
|
vscodeOniguruma.setDefaultDebugCall(true);
|
|
183
183
|
progress.report({
|
|
184
|
-
message: ( localize(
|
|
184
|
+
message: ( localize(3143, "Now logging TM Grammar parsing. Press Stop when finished."))
|
|
185
185
|
});
|
|
186
186
|
return (
|
|
187
187
|
(new Promise((resolve, reject) => { }))
|
|
@@ -313,8 +313,7 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
|
|
|
313
313
|
}
|
|
314
314
|
async _loadVSCodeOnigurumaWASM() {
|
|
315
315
|
if (isWeb) {
|
|
316
|
-
const response = await fetch(resolveAmdNodeModulePath('vscode-oniguruma', 'release/onig.wasm')
|
|
317
|
-
);
|
|
316
|
+
const response = await fetch(resolveAmdNodeModulePath('vscode-oniguruma', 'release/onig.wasm'));
|
|
318
317
|
return await response.arrayBuffer();
|
|
319
318
|
}
|
|
320
319
|
else {
|
|
@@ -389,7 +388,7 @@ function equalsTokenRules(a, b) {
|
|
|
389
388
|
function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _languageService) {
|
|
390
389
|
if (syntax.language && ((typeof syntax.language !== 'string') || !_languageService.isRegisteredLanguageId(syntax.language))) {
|
|
391
390
|
collector.error(( localize(
|
|
392
|
-
|
|
391
|
+
3144,
|
|
393
392
|
"Unknown language in `contributes.{0}.language`. Provided value: {1}",
|
|
394
393
|
grammarsExtPoint.name,
|
|
395
394
|
String(syntax.language)
|
|
@@ -398,7 +397,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
398
397
|
}
|
|
399
398
|
if (!syntax.scopeName || (typeof syntax.scopeName !== 'string')) {
|
|
400
399
|
collector.error(( localize(
|
|
401
|
-
|
|
400
|
+
3145,
|
|
402
401
|
"Expected string in `contributes.{0}.scopeName`. Provided value: {1}",
|
|
403
402
|
grammarsExtPoint.name,
|
|
404
403
|
String(syntax.scopeName)
|
|
@@ -407,7 +406,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
407
406
|
}
|
|
408
407
|
if (!syntax.path || (typeof syntax.path !== 'string')) {
|
|
409
408
|
collector.error(( localize(
|
|
410
|
-
|
|
409
|
+
3146,
|
|
411
410
|
"Expected string in `contributes.{0}.path`. Provided value: {1}",
|
|
412
411
|
grammarsExtPoint.name,
|
|
413
412
|
String(syntax.path)
|
|
@@ -416,7 +415,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
416
415
|
}
|
|
417
416
|
if (syntax.injectTo && (!Array.isArray(syntax.injectTo) || ( (syntax.injectTo.some(scope => typeof scope !== 'string'))))) {
|
|
418
417
|
collector.error(( localize(
|
|
419
|
-
|
|
418
|
+
3147,
|
|
420
419
|
"Invalid value in `contributes.{0}.injectTo`. Must be an array of language scope names. Provided value: {1}",
|
|
421
420
|
grammarsExtPoint.name,
|
|
422
421
|
JSON.stringify(syntax.injectTo)
|
|
@@ -425,7 +424,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
425
424
|
}
|
|
426
425
|
if (syntax.embeddedLanguages && !isObject(syntax.embeddedLanguages)) {
|
|
427
426
|
collector.error(( localize(
|
|
428
|
-
|
|
427
|
+
3148,
|
|
429
428
|
"Invalid value in `contributes.{0}.embeddedLanguages`. Must be an object map from scope name to language. Provided value: {1}",
|
|
430
429
|
grammarsExtPoint.name,
|
|
431
430
|
JSON.stringify(syntax.embeddedLanguages)
|
|
@@ -434,7 +433,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
434
433
|
}
|
|
435
434
|
if (syntax.tokenTypes && !isObject(syntax.tokenTypes)) {
|
|
436
435
|
collector.error(( localize(
|
|
437
|
-
|
|
436
|
+
3149,
|
|
438
437
|
"Invalid value in `contributes.{0}.tokenTypes`. Must be an object map from scope name to token type. Provided value: {1}",
|
|
439
438
|
grammarsExtPoint.name,
|
|
440
439
|
JSON.stringify(syntax.tokenTypes)
|
|
@@ -444,7 +443,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
444
443
|
const grammarLocation = joinPath(extensionLocation, syntax.path);
|
|
445
444
|
if (!isEqualOrParent(grammarLocation, extensionLocation)) {
|
|
446
445
|
collector.warn(( localize(
|
|
447
|
-
|
|
446
|
+
3150,
|
|
448
447
|
"Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",
|
|
449
448
|
grammarsExtPoint.name,
|
|
450
449
|
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(3151, '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(3152, 'The identifier of the semantic token type')),
|
|
20
20
|
pattern: typeAndModifierIdPattern,
|
|
21
|
-
patternErrorMessage: ( localize(
|
|
21
|
+
patternErrorMessage: ( localize(3153, 'Identifiers should be in the form letterOrDigit[_-letterOrDigit]*')),
|
|
22
22
|
},
|
|
23
23
|
superType: {
|
|
24
24
|
type: 'string',
|
|
25
|
-
description: ( localize(
|
|
25
|
+
description: ( localize(3154, 'The super type of the semantic token type')),
|
|
26
26
|
pattern: typeAndModifierIdPattern,
|
|
27
|
-
patternErrorMessage: ( localize(
|
|
27
|
+
patternErrorMessage: ( localize(3155, 'Super types should be in the form letterOrDigit[_-letterOrDigit]*')),
|
|
28
28
|
},
|
|
29
29
|
description: {
|
|
30
30
|
type: 'string',
|
|
31
|
-
description: ( localize(
|
|
31
|
+
description: ( localize(3156, '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(3157, '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(3158, 'The identifier of the semantic token modifier')),
|
|
48
48
|
pattern: typeAndModifierIdPattern,
|
|
49
|
-
patternErrorMessage: ( localize(
|
|
49
|
+
patternErrorMessage: ( localize(3159, 'Identifiers should be in the form letterOrDigit[_-letterOrDigit]*'))
|
|
50
50
|
},
|
|
51
51
|
description: {
|
|
52
52
|
type: 'string',
|
|
53
|
-
description: ( localize(
|
|
53
|
+
description: ( localize(3160, '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(3161, '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(3162, 'Lists the languge for which the defaults are.')),
|
|
69
69
|
type: 'string'
|
|
70
70
|
},
|
|
71
71
|
scopes: {
|
|
72
72
|
description: ( localize(
|
|
73
|
-
|
|
73
|
+
3163,
|
|
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
|
+
3164,
|
|
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
|
+
3165,
|
|
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
|
+
3166,
|
|
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
|
+
3167,
|
|
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(3168, "'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(3169, "'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(3170, "'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(3171, "'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
|
+
3172,
|
|
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
|
+
3173,
|
|
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
|
+
3174,
|
|
204
204
|
"configuration.semanticTokenScopes.scopes': Problems parsing selector {0}.",
|
|
205
205
|
selectorString
|
|
206
206
|
)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import '../vscode/src/vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.
|
|
1
|
+
import '../vscode/src/vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.workerMain.js';
|
package/vscode/src/vs/amdX.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { isESM } from 'vscode/vscode/vs/base/common/amd';
|
|
2
|
-
import { nodeModulesPath, FileAccess } from 'vscode/vscode/vs/base/common/network';
|
|
3
|
-
import 'vscode/vscode/vs/base/common/platform';
|
|
4
|
-
import { assertType } from 'vscode/vscode/vs/base/common/types';
|
|
5
|
-
import 'vscode/vscode/vs/base/common/path';
|
|
6
|
-
|
|
7
|
-
function resolveAmdNodeModulePath(nodeModuleName, pathInsideNodeModule) {
|
|
8
|
-
assertType(isESM);
|
|
9
|
-
const product = globalThis._VSCODE_PRODUCT_JSON;
|
|
10
|
-
Boolean((product ?? globalThis.vscode?.context?.configuration()?.product)?.commit);
|
|
11
|
-
const nodeModulePath = `${nodeModuleName}/${pathInsideNodeModule}`;
|
|
12
|
-
const actualNodeModulesPath = (nodeModulesPath);
|
|
13
|
-
const resourcePath = `${actualNodeModulesPath}/${nodeModulePath}`;
|
|
14
|
-
return ( ( FileAccess.asBrowserUri(resourcePath)).toString(true));
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { resolveAmdNodeModulePath };
|