@codingame/monaco-vscode-textmate-service-override 13.1.4 → 13.1.5
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/index.js +0 -6
- package/package.json +6 -7
- package/vscode/src/vs/workbench/services/textMate/browser/backgroundTokenization/threadedBackgroundTokenizerFactory.d.ts +1 -3
- package/vscode/src/vs/workbench/services/textMate/browser/backgroundTokenization/threadedBackgroundTokenizerFactory.js +4 -13
- package/vscode/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.js +12 -13
- package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +24 -24
package/index.js
CHANGED
|
@@ -8,15 +8,9 @@ import { LifecyclePhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench
|
|
|
8
8
|
import { ILifecycleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
9
9
|
import getServiceOverride$1 from '@codingame/monaco-vscode-files-service-override';
|
|
10
10
|
import { registerServiceInitializeParticipant } from '@codingame/monaco-vscode-api/lifecycle';
|
|
11
|
-
import { registerAssets } from '@codingame/monaco-vscode-api/assets';
|
|
12
11
|
import './vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js';
|
|
13
12
|
import '@codingame/monaco-vscode-7443a901-21f6-577a-9674-42893b997ee0-common/vscode/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens';
|
|
14
13
|
|
|
15
|
-
const _onigWasm = new URL('vscode-oniguruma/release/onig.wasm', import.meta.url).href;
|
|
16
|
-
registerAssets({
|
|
17
|
-
'vscode-oniguruma/../onig.wasm': _onigWasm,
|
|
18
|
-
'vs/../../node_modules/vscode-oniguruma/release/onig.wasm': _onigWasm
|
|
19
|
-
});
|
|
20
14
|
registerServiceInitializeParticipant(async (accessor) => {
|
|
21
15
|
void accessor
|
|
22
16
|
.get(ILifecycleService)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-textmate-service-override",
|
|
3
|
-
"version": "13.1.
|
|
3
|
+
"version": "13.1.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - textmate service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,12 +15,11 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-33833ac7-3af3-5e9d-8fb9-11838d852c59-common": "13.1.
|
|
19
|
-
"@codingame/monaco-vscode-695440c8-a687-5594-b476-bbc7b36bafe9-common": "13.1.
|
|
20
|
-
"@codingame/monaco-vscode-7443a901-21f6-577a-9674-42893b997ee0-common": "13.1.
|
|
21
|
-
"@codingame/monaco-vscode-api": "13.1.
|
|
22
|
-
"@codingame/monaco-vscode-
|
|
23
|
-
"@codingame/monaco-vscode-files-service-override": "13.1.4",
|
|
18
|
+
"@codingame/monaco-vscode-33833ac7-3af3-5e9d-8fb9-11838d852c59-common": "13.1.5",
|
|
19
|
+
"@codingame/monaco-vscode-695440c8-a687-5594-b476-bbc7b36bafe9-common": "13.1.5",
|
|
20
|
+
"@codingame/monaco-vscode-7443a901-21f6-577a-9674-42893b997ee0-common": "13.1.5",
|
|
21
|
+
"@codingame/monaco-vscode-api": "13.1.5",
|
|
22
|
+
"@codingame/monaco-vscode-files-service-override": "13.1.5",
|
|
24
23
|
"vscode-oniguruma": "1.7.0",
|
|
25
24
|
"vscode-textmate": "9.1.0"
|
|
26
25
|
},
|
|
@@ -4,7 +4,6 @@ import { IBackgroundTokenizationStore, IBackgroundTokenizer } from "@codingame/m
|
|
|
4
4
|
import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language";
|
|
5
5
|
import { ITextModel } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model";
|
|
6
6
|
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
7
|
-
import { IEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service";
|
|
8
7
|
import { IExtensionResourceLoaderService } from "@codingame/monaco-vscode-api/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader.service";
|
|
9
8
|
import { INotificationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service";
|
|
10
9
|
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
@@ -16,7 +15,6 @@ export declare class ThreadedBackgroundTokenizerFactory implements IDisposable {
|
|
|
16
15
|
private readonly _extensionResourceLoaderService;
|
|
17
16
|
private readonly _configurationService;
|
|
18
17
|
private readonly _languageService;
|
|
19
|
-
private readonly _environmentService;
|
|
20
18
|
private readonly _notificationService;
|
|
21
19
|
private readonly _telemetryService;
|
|
22
20
|
private static _reportedMismatchingTokens;
|
|
@@ -27,7 +25,7 @@ export declare class ThreadedBackgroundTokenizerFactory implements IDisposable {
|
|
|
27
25
|
private _currentTheme;
|
|
28
26
|
private _currentTokenColorMap;
|
|
29
27
|
private _grammarDefinitions;
|
|
30
|
-
constructor(_reportTokenizationTime: (timeMs: number, languageId: string, sourceExtensionId: string | undefined, lineLength: number, isRandomSample: boolean) => void, _shouldTokenizeAsync: () => boolean, _extensionResourceLoaderService: IExtensionResourceLoaderService, _configurationService: IConfigurationService, _languageService: ILanguageService,
|
|
28
|
+
constructor(_reportTokenizationTime: (timeMs: number, languageId: string, sourceExtensionId: string | undefined, lineLength: number, isRandomSample: boolean) => void, _shouldTokenizeAsync: () => boolean, _extensionResourceLoaderService: IExtensionResourceLoaderService, _configurationService: IConfigurationService, _languageService: ILanguageService, _notificationService: INotificationService, _telemetryService: ITelemetryService);
|
|
31
29
|
dispose(): void;
|
|
32
30
|
createBackgroundTokenizer(textModel: ITextModel, tokenStore: IBackgroundTokenizationStore, maxTokenizationLineLength: IObservable<number>): IBackgroundTokenizer | undefined;
|
|
33
31
|
setGrammarDefinitions(grammarDefinitions: IValidGrammarDefinition[]): void;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import '@codingame/monaco-vscode-cb805e61-7d70-50d9-b937-bf6481ea0c17-common/vscode/vs/amdX';
|
|
4
3
|
import { DisposableStore, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { nodeModulesPath, FileAccess } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
6
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
7
4
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
8
5
|
import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language';
|
|
9
6
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
10
|
-
import { IEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service';
|
|
11
7
|
import { IExtensionResourceLoaderService } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader.service';
|
|
12
8
|
import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
|
|
13
9
|
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
@@ -19,13 +15,12 @@ var ThreadedBackgroundTokenizerFactory_1;
|
|
|
19
15
|
let ThreadedBackgroundTokenizerFactory = class ThreadedBackgroundTokenizerFactory {
|
|
20
16
|
static { ThreadedBackgroundTokenizerFactory_1 = this; }
|
|
21
17
|
static { this._reportedMismatchingTokens = false; }
|
|
22
|
-
constructor(_reportTokenizationTime, _shouldTokenizeAsync, _extensionResourceLoaderService, _configurationService, _languageService,
|
|
18
|
+
constructor(_reportTokenizationTime, _shouldTokenizeAsync, _extensionResourceLoaderService, _configurationService, _languageService, _notificationService, _telemetryService) {
|
|
23
19
|
this._reportTokenizationTime = _reportTokenizationTime;
|
|
24
20
|
this._shouldTokenizeAsync = _shouldTokenizeAsync;
|
|
25
21
|
this._extensionResourceLoaderService = _extensionResourceLoaderService;
|
|
26
22
|
this._configurationService = _configurationService;
|
|
27
23
|
this._languageService = _languageService;
|
|
28
|
-
this._environmentService = _environmentService;
|
|
29
24
|
this._notificationService = _notificationService;
|
|
30
25
|
this._telemetryService = _telemetryService;
|
|
31
26
|
this._workerProxyPromise = null;
|
|
@@ -109,12 +104,9 @@ let ThreadedBackgroundTokenizerFactory = class ThreadedBackgroundTokenizerFactor
|
|
|
109
104
|
return this._workerProxyPromise;
|
|
110
105
|
}
|
|
111
106
|
async _createWorkerProxy() {
|
|
112
|
-
const onigurumaModuleLocation = `${nodeModulesPath}/vscode-oniguruma`;
|
|
113
|
-
const onigurumaLocation = onigurumaModuleLocation;
|
|
114
|
-
const onigurumaWASM = `${onigurumaLocation}/release/onig.wasm`;
|
|
115
107
|
const createData = {
|
|
116
108
|
grammarDefinitions: this._grammarDefinitions,
|
|
117
|
-
onigurumaWASMUri: ( (
|
|
109
|
+
onigurumaWASMUri: ( new URL('vscode-oniguruma/release/onig.wasm', import.meta.url)).href,
|
|
118
110
|
};
|
|
119
111
|
const worker = this._worker = createWebWorker('vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.worker', 'TextMateWorker');
|
|
120
112
|
TextMateWorkerHost.setChannel(worker, {
|
|
@@ -159,9 +151,8 @@ ThreadedBackgroundTokenizerFactory = ThreadedBackgroundTokenizerFactory_1 = ( __
|
|
|
159
151
|
( __param(2, IExtensionResourceLoaderService)),
|
|
160
152
|
( __param(3, IConfigurationService)),
|
|
161
153
|
( __param(4, ILanguageService)),
|
|
162
|
-
( __param(5,
|
|
163
|
-
( __param(6,
|
|
164
|
-
( __param(7, ITelemetryService))
|
|
154
|
+
( __param(5, INotificationService)),
|
|
155
|
+
( __param(6, ITelemetryService))
|
|
165
156
|
], ThreadedBackgroundTokenizerFactory));
|
|
166
157
|
function keepAliveWhenAttached(textModel, factory) {
|
|
167
158
|
const disposableStore = ( new DisposableStore());
|
package/vscode/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { createStyleSheet } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/domStylesheets';
|
|
4
|
-
import { resolveAmdNodeModulePath } from '@codingame/monaco-vscode-cb805e61-7d70-50d9-b937-bf6481ea0c17-common/vscode/vs/amdX';
|
|
5
4
|
import { equals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
6
5
|
import { Color } from '@codingame/monaco-vscode-api/vscode/vs/base/common/color';
|
|
7
6
|
import { onUnexpectedError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
@@ -168,7 +167,7 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
|
|
|
168
167
|
}
|
|
169
168
|
startDebugMode(printFn, onStop) {
|
|
170
169
|
if (this._debugMode) {
|
|
171
|
-
this._notificationService.error(( localize(
|
|
170
|
+
this._notificationService.error(( localize(11754, "Already Logging.")));
|
|
172
171
|
return;
|
|
173
172
|
}
|
|
174
173
|
this._debugModePrintFunc = printFn;
|
|
@@ -176,15 +175,15 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
|
|
|
176
175
|
if (this._debugMode) {
|
|
177
176
|
this._progressService.withProgress({
|
|
178
177
|
location: ProgressLocation.Notification,
|
|
179
|
-
buttons: [( localize(
|
|
178
|
+
buttons: [( localize(11755, "Stop"))]
|
|
180
179
|
}, (progress) => {
|
|
181
180
|
progress.report({
|
|
182
|
-
message: ( localize(
|
|
181
|
+
message: ( localize(11756, "Preparing to log TM Grammar parsing. Press Stop when finished."))
|
|
183
182
|
});
|
|
184
183
|
return this._getVSCodeOniguruma().then((vscodeOniguruma) => {
|
|
185
184
|
vscodeOniguruma.setDefaultDebugCall(true);
|
|
186
185
|
progress.report({
|
|
187
|
-
message: ( localize(
|
|
186
|
+
message: ( localize(11757, "Now logging TM Grammar parsing. Press Stop when finished."))
|
|
188
187
|
});
|
|
189
188
|
return ( new Promise((resolve, reject) => { }));
|
|
190
189
|
});
|
|
@@ -312,7 +311,7 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
|
|
|
312
311
|
}
|
|
313
312
|
async _loadVSCodeOnigurumaWASM() {
|
|
314
313
|
if (isWeb) {
|
|
315
|
-
const response = await fetch(
|
|
314
|
+
const response = await fetch(( new URL('vscode-oniguruma/release/onig.wasm', import.meta.url)).href);
|
|
316
315
|
return await response.arrayBuffer();
|
|
317
316
|
}
|
|
318
317
|
else {
|
|
@@ -387,7 +386,7 @@ function equalsTokenRules(a, b) {
|
|
|
387
386
|
function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _languageService) {
|
|
388
387
|
if (syntax.language && ((typeof syntax.language !== 'string') || !_languageService.isRegisteredLanguageId(syntax.language))) {
|
|
389
388
|
collector.error(( localize(
|
|
390
|
-
|
|
389
|
+
11758,
|
|
391
390
|
"Unknown language in `contributes.{0}.language`. Provided value: {1}",
|
|
392
391
|
grammarsExtPoint.name,
|
|
393
392
|
String(syntax.language)
|
|
@@ -396,7 +395,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
396
395
|
}
|
|
397
396
|
if (!syntax.scopeName || (typeof syntax.scopeName !== 'string')) {
|
|
398
397
|
collector.error(( localize(
|
|
399
|
-
|
|
398
|
+
11759,
|
|
400
399
|
"Expected string in `contributes.{0}.scopeName`. Provided value: {1}",
|
|
401
400
|
grammarsExtPoint.name,
|
|
402
401
|
String(syntax.scopeName)
|
|
@@ -405,7 +404,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
405
404
|
}
|
|
406
405
|
if (!syntax.path || (typeof syntax.path !== 'string')) {
|
|
407
406
|
collector.error(( localize(
|
|
408
|
-
|
|
407
|
+
11760,
|
|
409
408
|
"Expected string in `contributes.{0}.path`. Provided value: {1}",
|
|
410
409
|
grammarsExtPoint.name,
|
|
411
410
|
String(syntax.path)
|
|
@@ -414,7 +413,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
414
413
|
}
|
|
415
414
|
if (syntax.injectTo && (!Array.isArray(syntax.injectTo) || ( syntax.injectTo.some(scope => typeof scope !== 'string')))) {
|
|
416
415
|
collector.error(( localize(
|
|
417
|
-
|
|
416
|
+
11761,
|
|
418
417
|
"Invalid value in `contributes.{0}.injectTo`. Must be an array of language scope names. Provided value: {1}",
|
|
419
418
|
grammarsExtPoint.name,
|
|
420
419
|
JSON.stringify(syntax.injectTo)
|
|
@@ -423,7 +422,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
423
422
|
}
|
|
424
423
|
if (syntax.embeddedLanguages && !isObject(syntax.embeddedLanguages)) {
|
|
425
424
|
collector.error(( localize(
|
|
426
|
-
|
|
425
|
+
11762,
|
|
427
426
|
"Invalid value in `contributes.{0}.embeddedLanguages`. Must be an object map from scope name to language. Provided value: {1}",
|
|
428
427
|
grammarsExtPoint.name,
|
|
429
428
|
JSON.stringify(syntax.embeddedLanguages)
|
|
@@ -432,7 +431,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
432
431
|
}
|
|
433
432
|
if (syntax.tokenTypes && !isObject(syntax.tokenTypes)) {
|
|
434
433
|
collector.error(( localize(
|
|
435
|
-
|
|
434
|
+
11763,
|
|
436
435
|
"Invalid value in `contributes.{0}.tokenTypes`. Must be an object map from scope name to token type. Provided value: {1}",
|
|
437
436
|
grammarsExtPoint.name,
|
|
438
437
|
JSON.stringify(syntax.tokenTypes)
|
|
@@ -442,7 +441,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
442
441
|
const grammarLocation = joinPath(extensionLocation, syntax.path);
|
|
443
442
|
if (!isEqualOrParent(grammarLocation, extensionLocation)) {
|
|
444
443
|
collector.warn(( localize(
|
|
445
|
-
|
|
444
|
+
11764,
|
|
446
445
|
"Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",
|
|
447
446
|
grammarsExtPoint.name,
|
|
448
447
|
grammarLocation.path,
|
|
@@ -10,26 +10,26 @@ const tokenClassificationRegistry = getTokenClassificationRegistry();
|
|
|
10
10
|
const tokenTypeExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
11
11
|
extensionPoint: 'semanticTokenTypes',
|
|
12
12
|
jsonSchema: {
|
|
13
|
-
description: ( localize(
|
|
13
|
+
description: ( localize(11965, 'Contributes semantic token types.')),
|
|
14
14
|
type: 'array',
|
|
15
15
|
items: {
|
|
16
16
|
type: 'object',
|
|
17
17
|
properties: {
|
|
18
18
|
id: {
|
|
19
19
|
type: 'string',
|
|
20
|
-
description: ( localize(
|
|
20
|
+
description: ( localize(11966, 'The identifier of the semantic token type')),
|
|
21
21
|
pattern: typeAndModifierIdPattern,
|
|
22
|
-
patternErrorMessage: ( localize(
|
|
22
|
+
patternErrorMessage: ( localize(11967, 'Identifiers should be in the form letterOrDigit[_-letterOrDigit]*')),
|
|
23
23
|
},
|
|
24
24
|
superType: {
|
|
25
25
|
type: 'string',
|
|
26
|
-
description: ( localize(
|
|
26
|
+
description: ( localize(11968, 'The super type of the semantic token type')),
|
|
27
27
|
pattern: typeAndModifierIdPattern,
|
|
28
|
-
patternErrorMessage: ( localize(
|
|
28
|
+
patternErrorMessage: ( localize(11969, 'Super types should be in the form letterOrDigit[_-letterOrDigit]*')),
|
|
29
29
|
},
|
|
30
30
|
description: {
|
|
31
31
|
type: 'string',
|
|
32
|
-
description: ( localize(
|
|
32
|
+
description: ( localize(11970, 'The description of the semantic token type')),
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -38,20 +38,20 @@ const tokenTypeExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
|
38
38
|
const tokenModifierExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
39
39
|
extensionPoint: 'semanticTokenModifiers',
|
|
40
40
|
jsonSchema: {
|
|
41
|
-
description: ( localize(
|
|
41
|
+
description: ( localize(11971, 'Contributes semantic token modifiers.')),
|
|
42
42
|
type: 'array',
|
|
43
43
|
items: {
|
|
44
44
|
type: 'object',
|
|
45
45
|
properties: {
|
|
46
46
|
id: {
|
|
47
47
|
type: 'string',
|
|
48
|
-
description: ( localize(
|
|
48
|
+
description: ( localize(11972, 'The identifier of the semantic token modifier')),
|
|
49
49
|
pattern: typeAndModifierIdPattern,
|
|
50
|
-
patternErrorMessage: ( localize(
|
|
50
|
+
patternErrorMessage: ( localize(11973, 'Identifiers should be in the form letterOrDigit[_-letterOrDigit]*'))
|
|
51
51
|
},
|
|
52
52
|
description: {
|
|
53
53
|
type: 'string',
|
|
54
|
-
description: ( localize(
|
|
54
|
+
description: ( localize(11974, 'The description of the semantic token modifier'))
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -60,18 +60,18 @@ const tokenModifierExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
|
60
60
|
const tokenStyleDefaultsExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
61
61
|
extensionPoint: 'semanticTokenScopes',
|
|
62
62
|
jsonSchema: {
|
|
63
|
-
description: ( localize(
|
|
63
|
+
description: ( localize(11975, 'Contributes semantic token scope maps.')),
|
|
64
64
|
type: 'array',
|
|
65
65
|
items: {
|
|
66
66
|
type: 'object',
|
|
67
67
|
properties: {
|
|
68
68
|
language: {
|
|
69
|
-
description: ( localize(
|
|
69
|
+
description: ( localize(11976, 'Lists the languge for which the defaults are.')),
|
|
70
70
|
type: 'string'
|
|
71
71
|
},
|
|
72
72
|
scopes: {
|
|
73
73
|
description: ( localize(
|
|
74
|
-
|
|
74
|
+
11977,
|
|
75
75
|
'Maps a semantic token (described by semantic token selector) to one or more textMate scopes used to represent that token.'
|
|
76
76
|
)),
|
|
77
77
|
type: 'object',
|
|
@@ -91,7 +91,7 @@ class TokenClassificationExtensionPoints {
|
|
|
91
91
|
function validateTypeOrModifier(contribution, extensionPoint, collector) {
|
|
92
92
|
if (typeof contribution.id !== 'string' || contribution.id.length === 0) {
|
|
93
93
|
collector.error(( localize(
|
|
94
|
-
|
|
94
|
+
11978,
|
|
95
95
|
"'configuration.{0}.id' must be defined and can not be empty",
|
|
96
96
|
extensionPoint
|
|
97
97
|
)));
|
|
@@ -99,7 +99,7 @@ class TokenClassificationExtensionPoints {
|
|
|
99
99
|
}
|
|
100
100
|
if (!contribution.id.match(typeAndModifierIdPattern)) {
|
|
101
101
|
collector.error(( localize(
|
|
102
|
-
|
|
102
|
+
11979,
|
|
103
103
|
"'configuration.{0}.id' must follow the pattern letterOrDigit[-_letterOrDigit]*",
|
|
104
104
|
extensionPoint
|
|
105
105
|
)));
|
|
@@ -108,7 +108,7 @@ class TokenClassificationExtensionPoints {
|
|
|
108
108
|
const superType = contribution.superType;
|
|
109
109
|
if (superType && !superType.match(typeAndModifierIdPattern)) {
|
|
110
110
|
collector.error(( localize(
|
|
111
|
-
|
|
111
|
+
11980,
|
|
112
112
|
"'configuration.{0}.superType' must follow the pattern letterOrDigit[-_letterOrDigit]*",
|
|
113
113
|
extensionPoint
|
|
114
114
|
)));
|
|
@@ -116,7 +116,7 @@ class TokenClassificationExtensionPoints {
|
|
|
116
116
|
}
|
|
117
117
|
if (typeof contribution.description !== 'string' || contribution.id.length === 0) {
|
|
118
118
|
collector.error(( localize(
|
|
119
|
-
|
|
119
|
+
11981,
|
|
120
120
|
"'configuration.{0}.description' must be defined and can not be empty",
|
|
121
121
|
extensionPoint
|
|
122
122
|
)));
|
|
@@ -129,7 +129,7 @@ class TokenClassificationExtensionPoints {
|
|
|
129
129
|
const extensionValue = extension.value;
|
|
130
130
|
const collector = extension.collector;
|
|
131
131
|
if (!extensionValue || !Array.isArray(extensionValue)) {
|
|
132
|
-
collector.error(( localize(
|
|
132
|
+
collector.error(( localize(11982, "'configuration.semanticTokenType' must be an array")));
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
135
|
for (const contribution of extensionValue) {
|
|
@@ -150,7 +150,7 @@ class TokenClassificationExtensionPoints {
|
|
|
150
150
|
const extensionValue = extension.value;
|
|
151
151
|
const collector = extension.collector;
|
|
152
152
|
if (!extensionValue || !Array.isArray(extensionValue)) {
|
|
153
|
-
collector.error(( localize(
|
|
153
|
+
collector.error(( localize(11983, "'configuration.semanticTokenModifier' must be an array")));
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
156
|
for (const contribution of extensionValue) {
|
|
@@ -171,17 +171,17 @@ class TokenClassificationExtensionPoints {
|
|
|
171
171
|
const extensionValue = extension.value;
|
|
172
172
|
const collector = extension.collector;
|
|
173
173
|
if (!extensionValue || !Array.isArray(extensionValue)) {
|
|
174
|
-
collector.error(( localize(
|
|
174
|
+
collector.error(( localize(11984, "'configuration.semanticTokenScopes' must be an array")));
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
177
|
for (const contribution of extensionValue) {
|
|
178
178
|
if (contribution.language && typeof contribution.language !== 'string') {
|
|
179
|
-
collector.error(( localize(
|
|
179
|
+
collector.error(( localize(11985, "'configuration.semanticTokenScopes.language' must be a string")));
|
|
180
180
|
continue;
|
|
181
181
|
}
|
|
182
182
|
if (!contribution.scopes || typeof contribution.scopes !== 'object') {
|
|
183
183
|
collector.error(( localize(
|
|
184
|
-
|
|
184
|
+
11986,
|
|
185
185
|
"'configuration.semanticTokenScopes.scopes' must be defined as an object"
|
|
186
186
|
)));
|
|
187
187
|
continue;
|
|
@@ -190,7 +190,7 @@ class TokenClassificationExtensionPoints {
|
|
|
190
190
|
const tmScopes = contribution.scopes[selectorString];
|
|
191
191
|
if (!Array.isArray(tmScopes) || ( tmScopes.some(l => typeof l !== 'string'))) {
|
|
192
192
|
collector.error(( localize(
|
|
193
|
-
|
|
193
|
+
11987,
|
|
194
194
|
"'configuration.semanticTokenScopes.scopes' values must be an array of strings"
|
|
195
195
|
)));
|
|
196
196
|
continue;
|
|
@@ -201,7 +201,7 @@ class TokenClassificationExtensionPoints {
|
|
|
201
201
|
}
|
|
202
202
|
catch (e) {
|
|
203
203
|
collector.error(( localize(
|
|
204
|
-
|
|
204
|
+
11988,
|
|
205
205
|
"configuration.semanticTokenScopes.scopes': Problems parsing selector {0}.",
|
|
206
206
|
selectorString
|
|
207
207
|
)));
|