@codingame/monaco-vscode-textmate-service-override 36.2.7 → 37.0.0
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-textmate-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "37.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - textmate service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
19
|
-
"@codingame/monaco-vscode-files-service-override": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "37.0.0",
|
|
19
|
+
"@codingame/monaco-vscode-files-service-override": "37.0.0"
|
|
20
20
|
},
|
|
21
21
|
"main": "index.js",
|
|
22
22
|
"module": "index.js",
|
package/vscode/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.js
CHANGED
|
@@ -5,7 +5,7 @@ import { equals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/array
|
|
|
5
5
|
import { Color } from '@codingame/monaco-vscode-api/vscode/vs/base/common/color';
|
|
6
6
|
import { onUnexpectedError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
7
7
|
import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
8
|
-
import { FileAccess, nodeModulesPath } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
8
|
+
import { FileAccess, nodeModulesAsarUnpackedPath, nodeModulesPath } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
9
9
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
10
10
|
import { isWeb } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
11
11
|
import { joinPath, isEqualOrParent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
@@ -197,7 +197,7 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
|
|
|
197
197
|
}
|
|
198
198
|
startDebugMode(printFn, onStop) {
|
|
199
199
|
if (this._debugMode) {
|
|
200
|
-
this._notificationService.error(( localize(
|
|
200
|
+
this._notificationService.error(( localize(19699, "Already Logging.")));
|
|
201
201
|
return;
|
|
202
202
|
}
|
|
203
203
|
this._debugModePrintFunc = printFn;
|
|
@@ -205,15 +205,15 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
|
|
|
205
205
|
if (this._debugMode) {
|
|
206
206
|
this._progressService.withProgress({
|
|
207
207
|
location: ProgressLocation.Notification,
|
|
208
|
-
buttons: [( localize(
|
|
208
|
+
buttons: [( localize(19700, "Stop"))]
|
|
209
209
|
}, progress => {
|
|
210
210
|
progress.report({
|
|
211
|
-
message: ( localize(
|
|
211
|
+
message: ( localize(19701, "Preparing to log TM Grammar parsing. Press Stop when finished."))
|
|
212
212
|
});
|
|
213
213
|
return this._getVSCodeOniguruma().then(vscodeOniguruma => {
|
|
214
214
|
vscodeOniguruma.setDefaultDebugCall(true);
|
|
215
215
|
progress.report({
|
|
216
|
-
message: ( localize(
|
|
216
|
+
message: ( localize(19702, "Now logging TM Grammar parsing. Press Stop when finished."))
|
|
217
217
|
});
|
|
218
218
|
return ( new Promise((resolve, reject) => {}));
|
|
219
219
|
});
|
|
@@ -338,14 +338,19 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
|
|
|
338
338
|
_getVSCodeOniguruma() {
|
|
339
339
|
if (!this._vscodeOniguruma) {
|
|
340
340
|
this._vscodeOniguruma = (async () => {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
341
|
+
try {
|
|
342
|
+
const [vscodeOniguruma, wasm] = await Promise.all([import('../../../../../../../_virtual/main2.js').then(function (n) { return n.main; }), this._loadVSCodeOnigurumaWASM()]);
|
|
343
|
+
await vscodeOniguruma.loadWASM({
|
|
344
|
+
data: wasm,
|
|
345
|
+
print: str => {
|
|
346
|
+
this._debugModePrintFunc(str);
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
return vscodeOniguruma;
|
|
350
|
+
} catch (err) {
|
|
351
|
+
this._vscodeOniguruma = null;
|
|
352
|
+
throw err;
|
|
353
|
+
}
|
|
349
354
|
})();
|
|
350
355
|
}
|
|
351
356
|
return this._vscodeOniguruma;
|
|
@@ -355,7 +360,7 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
|
|
|
355
360
|
const response = await fetch(( new URL('../../../../../../../external/vscode-oniguruma/release/onig.wasm', import.meta.url)).href);
|
|
356
361
|
return await response.arrayBuffer();
|
|
357
362
|
} else {
|
|
358
|
-
const response = await fetch(( ( FileAccess.asBrowserUri(`${nodeModulesPath}/vscode-oniguruma/release/onig.wasm`)).toString(true)));
|
|
363
|
+
const response = await fetch(this._environmentService.isBuilt ? ( ( FileAccess.asBrowserUri(`${nodeModulesAsarUnpackedPath}/vscode-oniguruma/release/onig.wasm`)).toString(true)) : ( ( FileAccess.asBrowserUri(`${nodeModulesPath}/vscode-oniguruma/release/onig.wasm`)).toString(true)));
|
|
359
364
|
return response;
|
|
360
365
|
}
|
|
361
366
|
}
|
|
@@ -421,7 +426,7 @@ function equalsTokenRules(a, b) {
|
|
|
421
426
|
function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _languageService) {
|
|
422
427
|
if (syntax.language && ((typeof syntax.language !== "string") || !_languageService.isRegisteredLanguageId(syntax.language))) {
|
|
423
428
|
collector.error(( localize(
|
|
424
|
-
|
|
429
|
+
19703,
|
|
425
430
|
"Unknown language in `contributes.{0}.language`. Provided value: {1}",
|
|
426
431
|
grammarsExtPoint.name,
|
|
427
432
|
String(syntax.language)
|
|
@@ -430,7 +435,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
430
435
|
}
|
|
431
436
|
if (!syntax.scopeName || (typeof syntax.scopeName !== "string")) {
|
|
432
437
|
collector.error(( localize(
|
|
433
|
-
|
|
438
|
+
19704,
|
|
434
439
|
"Expected string in `contributes.{0}.scopeName`. Provided value: {1}",
|
|
435
440
|
grammarsExtPoint.name,
|
|
436
441
|
String(syntax.scopeName)
|
|
@@ -439,7 +444,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
439
444
|
}
|
|
440
445
|
if (!syntax.path || (typeof syntax.path !== "string")) {
|
|
441
446
|
collector.error(( localize(
|
|
442
|
-
|
|
447
|
+
19705,
|
|
443
448
|
"Expected string in `contributes.{0}.path`. Provided value: {1}",
|
|
444
449
|
grammarsExtPoint.name,
|
|
445
450
|
String(syntax.path)
|
|
@@ -448,7 +453,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
448
453
|
}
|
|
449
454
|
if (syntax.injectTo && (!Array.isArray(syntax.injectTo) || ( syntax.injectTo.some(scope => typeof scope !== "string")))) {
|
|
450
455
|
collector.error(( localize(
|
|
451
|
-
|
|
456
|
+
19706,
|
|
452
457
|
"Invalid value in `contributes.{0}.injectTo`. Must be an array of language scope names. Provided value: {1}",
|
|
453
458
|
grammarsExtPoint.name,
|
|
454
459
|
JSON.stringify(syntax.injectTo)
|
|
@@ -457,7 +462,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
457
462
|
}
|
|
458
463
|
if (syntax.embeddedLanguages && !isObject(syntax.embeddedLanguages)) {
|
|
459
464
|
collector.error(( localize(
|
|
460
|
-
|
|
465
|
+
19707,
|
|
461
466
|
"Invalid value in `contributes.{0}.embeddedLanguages`. Must be an object map from scope name to language. Provided value: {1}",
|
|
462
467
|
grammarsExtPoint.name,
|
|
463
468
|
JSON.stringify(syntax.embeddedLanguages)
|
|
@@ -466,7 +471,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
466
471
|
}
|
|
467
472
|
if (syntax.tokenTypes && !isObject(syntax.tokenTypes)) {
|
|
468
473
|
collector.error(( localize(
|
|
469
|
-
|
|
474
|
+
19708,
|
|
470
475
|
"Invalid value in `contributes.{0}.tokenTypes`. Must be an object map from scope name to token type. Provided value: {1}",
|
|
471
476
|
grammarsExtPoint.name,
|
|
472
477
|
JSON.stringify(syntax.tokenTypes)
|
|
@@ -476,7 +481,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
476
481
|
const grammarLocation = joinPath(extensionLocation, syntax.path);
|
|
477
482
|
if (!isEqualOrParent(grammarLocation, extensionLocation)) {
|
|
478
483
|
collector.warn(( localize(
|
|
479
|
-
|
|
484
|
+
19709,
|
|
480
485
|
"Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",
|
|
481
486
|
grammarsExtPoint.name,
|
|
482
487
|
grammarLocation.path,
|