@codingame/monaco-vscode-api 1.69.8 → 1.69.9
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/dist/api.js +6 -6
- package/dist/configuration.js +74 -384
- package/dist/contextkey.js +1 -13
- package/dist/dialogs.js +11 -11
- package/dist/extHost.js +1402 -2068
- package/dist/files.js +106 -100
- package/dist/keybindings.js +308 -358
- package/dist/languageConfiguration.js +4 -4
- package/dist/languageService.js +2 -2
- package/dist/languages.js +3 -3
- package/dist/layout.js +310 -292
- package/dist/missing-services.js +867 -5546
- package/dist/modelEditor.js +67 -67
- package/dist/monaco.js +13 -13
- package/dist/notifications.js +336 -266
- package/dist/polyfill.js +395 -394
- package/dist/services.js +1 -1
- package/dist/services2.js +27 -659
- package/dist/snippets.js +112 -104
- package/dist/textmate.js +88 -80
- package/dist/theme.js +408 -396
- package/dist/tokenClassification.js +3 -3
- package/dist/tokenClassificationRegistry.js +83 -77
- package/dist/workbenchThemeService.js +1 -1
- package/dist/workspaceContext.js +1 -1
- package/package.json +1 -1
package/dist/textmate.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as __decorate, a as __param } from './contextkey.js';
|
|
2
2
|
import { E as Emitter } from './polyfill.js';
|
|
3
|
-
import {
|
|
3
|
+
import { j as ExtensionMessageCollector, n as ITextMateService, E as ExtensionsRegistry } from './missing-services.js';
|
|
4
4
|
export { n as ITextMateService } from './missing-services.js';
|
|
5
5
|
import { l as languagesExtPoint } from './languageService.js';
|
|
6
6
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
7
7
|
import { I as IWorkbenchThemeService } from './workbenchThemeService.js';
|
|
8
8
|
import { Disposable, dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { joinPath, isEqualOrParent, isEqual } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
10
|
+
import { r as registerExtensionFile, g as getServiceOverride$1, I as IExtensionResourceLoaderService } from './files.js';
|
|
11
|
+
import { TokenizationRegistry, EncodedTokenizationResult } from 'monaco-editor/esm/vs/editor/common/languages.js';
|
|
12
12
|
import { TokenMetadata } from 'monaco-editor/esm/vs/editor/common/encodedTokenAttributes.js';
|
|
13
13
|
import { createStyleSheet } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
14
14
|
import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
@@ -22,20 +22,20 @@ import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
|
22
22
|
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
23
23
|
import { IProgressService } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
|
|
24
24
|
import { nullTokenizeEncoded } from 'monaco-editor/esm/vs/editor/common/languages/nullTokenize.js';
|
|
25
|
-
import { g as getExtensionPoint,
|
|
25
|
+
import { g as getExtensionPoint, c as consoleExtensionMessageHandler, o as onServicesInitialized } from './tools.js';
|
|
26
26
|
import { S as Services } from './services2.js';
|
|
27
|
-
import {
|
|
27
|
+
import { bd as DEFAULT_EXTENSION } from './extHost.js';
|
|
28
28
|
import { c as createInjectedClass } from './injection.js';
|
|
29
29
|
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
30
30
|
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
31
|
-
const grammarsExtPoint = ( ExtensionsRegistry.registerExtensionPoint({
|
|
31
|
+
const grammarsExtPoint = ( (ExtensionsRegistry.registerExtensionPoint({
|
|
32
32
|
extensionPoint: 'grammars',
|
|
33
33
|
deps: [languagesExtPoint],
|
|
34
34
|
jsonSchema: {
|
|
35
|
-
description: ( localize(
|
|
35
|
+
description: ( (localize(
|
|
36
36
|
'vscode.extension.contributes.grammars',
|
|
37
37
|
'Contributes textmate tokenizers.'
|
|
38
|
-
)),
|
|
38
|
+
))),
|
|
39
39
|
type: 'array',
|
|
40
40
|
defaultSnippets: [{ body: [{ language: '${1:id}', scopeName: 'source.${2:id}', path: './syntaxes/${3:id}.tmLanguage.' }] }],
|
|
41
41
|
items: {
|
|
@@ -43,58 +43,58 @@ const grammarsExtPoint = ( ExtensionsRegistry.registerExtensionPoint({
|
|
|
43
43
|
defaultSnippets: [{ body: { language: '${1:id}', scopeName: 'source.${2:id}', path: './syntaxes/${3:id}.tmLanguage.' } }],
|
|
44
44
|
properties: {
|
|
45
45
|
language: {
|
|
46
|
-
description: ( localize(
|
|
46
|
+
description: ( (localize(
|
|
47
47
|
'vscode.extension.contributes.grammars.language',
|
|
48
48
|
'Language identifier for which this syntax is contributed to.'
|
|
49
|
-
)),
|
|
49
|
+
))),
|
|
50
50
|
type: 'string'
|
|
51
51
|
},
|
|
52
52
|
scopeName: {
|
|
53
|
-
description: ( localize(
|
|
53
|
+
description: ( (localize(
|
|
54
54
|
'vscode.extension.contributes.grammars.scopeName',
|
|
55
55
|
'Textmate scope name used by the tmLanguage file.'
|
|
56
|
-
)),
|
|
56
|
+
))),
|
|
57
57
|
type: 'string'
|
|
58
58
|
},
|
|
59
59
|
path: {
|
|
60
|
-
description: ( localize(
|
|
60
|
+
description: ( (localize(
|
|
61
61
|
'vscode.extension.contributes.grammars.path',
|
|
62
62
|
'Path of the tmLanguage file. The path is relative to the extension folder and typically starts with \'./syntaxes/\'.'
|
|
63
|
-
)),
|
|
63
|
+
))),
|
|
64
64
|
type: 'string'
|
|
65
65
|
},
|
|
66
66
|
embeddedLanguages: {
|
|
67
|
-
description: ( localize(
|
|
67
|
+
description: ( (localize(
|
|
68
68
|
'vscode.extension.contributes.grammars.embeddedLanguages',
|
|
69
69
|
'A map of scope name to language id if this grammar contains embedded languages.'
|
|
70
|
-
)),
|
|
70
|
+
))),
|
|
71
71
|
type: 'object'
|
|
72
72
|
},
|
|
73
73
|
tokenTypes: {
|
|
74
|
-
description: ( localize(
|
|
74
|
+
description: ( (localize(
|
|
75
75
|
'vscode.extension.contributes.grammars.tokenTypes',
|
|
76
76
|
'A map of scope name to token types.'
|
|
77
|
-
)),
|
|
77
|
+
))),
|
|
78
78
|
type: 'object',
|
|
79
79
|
additionalProperties: {
|
|
80
80
|
enum: ['string', 'comment', 'other']
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
injectTo: {
|
|
84
|
-
description: ( localize(
|
|
84
|
+
description: ( (localize(
|
|
85
85
|
'vscode.extension.contributes.grammars.injectTo',
|
|
86
86
|
'List of language scope names to which this grammar is injected to.'
|
|
87
|
-
)),
|
|
87
|
+
))),
|
|
88
88
|
type: 'array',
|
|
89
89
|
items: {
|
|
90
90
|
type: 'string'
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
balancedBracketScopes: {
|
|
94
|
-
description: ( localize(
|
|
94
|
+
description: ( (localize(
|
|
95
95
|
'vscode.extension.contributes.grammars.balancedBracketScopes',
|
|
96
96
|
'Defines which scope names contain balanced brackets.'
|
|
97
|
-
)),
|
|
97
|
+
))),
|
|
98
98
|
type: 'array',
|
|
99
99
|
items: {
|
|
100
100
|
type: 'string'
|
|
@@ -102,10 +102,10 @@ const grammarsExtPoint = ( ExtensionsRegistry.registerExtensionPoint({
|
|
|
102
102
|
default: ['*'],
|
|
103
103
|
},
|
|
104
104
|
unbalancedBracketScopes: {
|
|
105
|
-
description: ( localize(
|
|
105
|
+
description: ( (localize(
|
|
106
106
|
'vscode.extension.contributes.grammars.unbalancedBracketScopes',
|
|
107
107
|
'Defines which scope names do not contain balanced brackets.'
|
|
108
|
-
)),
|
|
108
|
+
))),
|
|
109
109
|
type: 'array',
|
|
110
110
|
items: {
|
|
111
111
|
type: 'string'
|
|
@@ -116,7 +116,7 @@ const grammarsExtPoint = ( ExtensionsRegistry.registerExtensionPoint({
|
|
|
116
116
|
required: ['scopeName', 'path']
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
}));
|
|
119
|
+
})));
|
|
120
120
|
class TMScopeRegistry extends Disposable {
|
|
121
121
|
constructor() {
|
|
122
122
|
super();
|
|
@@ -130,8 +130,8 @@ class TMScopeRegistry extends Disposable {
|
|
|
130
130
|
const existingRegistration = this._scopeNameToLanguageRegistration[def.scopeName];
|
|
131
131
|
if (!isEqual(existingRegistration.location, def.location)) {
|
|
132
132
|
console.warn(`Overwriting grammar scope name to file mapping for scope ${def.scopeName}.\n` +
|
|
133
|
-
`Old grammar file: ${( existingRegistration.location.toString())}.\n` +
|
|
134
|
-
`New grammar file: ${( def.location.toString())}`);
|
|
133
|
+
`Old grammar file: ${( ( existingRegistration.location.toString()))}.\n` +
|
|
134
|
+
`New grammar file: ${( ( def.location.toString()))}`);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
this._scopeNameToLanguageRegistration[def.scopeName] = def;
|
|
@@ -146,10 +146,10 @@ class TMGrammarFactory extends Disposable {
|
|
|
146
146
|
super();
|
|
147
147
|
this._host = host;
|
|
148
148
|
this._initialState = vscodeTextmate.INITIAL;
|
|
149
|
-
this._scopeRegistry = this._register(( new TMScopeRegistry()));
|
|
149
|
+
this._scopeRegistry = this._register(( (new TMScopeRegistry())));
|
|
150
150
|
this._injections = {};
|
|
151
151
|
this._injectedEmbeddedLanguages = {};
|
|
152
|
-
this._languageToScope = ( new Map());
|
|
152
|
+
this._languageToScope = ( (new Map()));
|
|
153
153
|
this._grammarRegistry = this._register(new vscodeTextmate.Registry({
|
|
154
154
|
onigLib: onigLib,
|
|
155
155
|
loadGrammar: async (scopeName) => {
|
|
@@ -225,12 +225,12 @@ class TMGrammarFactory extends Disposable {
|
|
|
225
225
|
if (this._injectedEmbeddedLanguages[scopeName]) {
|
|
226
226
|
const injectedEmbeddedLanguages = this._injectedEmbeddedLanguages[scopeName];
|
|
227
227
|
for (const injected of injectedEmbeddedLanguages) {
|
|
228
|
-
for (const scope of ( Object.keys(injected))) {
|
|
228
|
+
for (const scope of ( (Object.keys(injected)))) {
|
|
229
229
|
embeddedLanguages[scope] = injected[scope];
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
const containsEmbeddedLanguages = (( Object.keys(embeddedLanguages)).length > 0);
|
|
233
|
+
const containsEmbeddedLanguages = (( (Object.keys(embeddedLanguages))).length > 0);
|
|
234
234
|
let grammar;
|
|
235
235
|
try {
|
|
236
236
|
grammar = await this._grammarRegistry.loadGrammarWithConfiguration(scopeName, encodedLanguageId, {
|
|
@@ -257,7 +257,7 @@ class TMGrammarFactory extends Disposable {
|
|
|
257
257
|
class TMTokenization extends Disposable {
|
|
258
258
|
constructor(grammar, initialState, containsEmbeddedLanguages) {
|
|
259
259
|
super();
|
|
260
|
-
this._onDidEncounterLanguage = this._register(( new Emitter()));
|
|
260
|
+
this._onDidEncounterLanguage = this._register(( (new Emitter())));
|
|
261
261
|
this.onDidEncounterLanguage = this._onDidEncounterLanguage.event;
|
|
262
262
|
this._grammar = grammar;
|
|
263
263
|
this._initialState = initialState;
|
|
@@ -274,7 +274,9 @@ class TMTokenization extends Disposable {
|
|
|
274
274
|
const textMateResult = this._grammar.tokenizeLine2(line, state, 500);
|
|
275
275
|
if (textMateResult.stoppedEarly) {
|
|
276
276
|
console.warn(`Time limit reached when tokenizing line: ${line.substring(0, 100)}`);
|
|
277
|
-
return (
|
|
277
|
+
return (
|
|
278
|
+
(new EncodedTokenizationResult(textMateResult.tokens, state))
|
|
279
|
+
);
|
|
278
280
|
}
|
|
279
281
|
if (this._containsEmbeddedLanguages) {
|
|
280
282
|
const seenLanguages = this._seenLanguages;
|
|
@@ -295,7 +297,9 @@ class TMTokenization extends Disposable {
|
|
|
295
297
|
else {
|
|
296
298
|
endState = textMateResult.ruleStack;
|
|
297
299
|
}
|
|
298
|
-
return (
|
|
300
|
+
return (
|
|
301
|
+
(new EncodedTokenizationResult(textMateResult.tokens, endState))
|
|
302
|
+
);
|
|
299
303
|
}
|
|
300
304
|
}
|
|
301
305
|
let AbstractTextMateService = class AbstractTextMateService extends Disposable {
|
|
@@ -308,7 +312,7 @@ let AbstractTextMateService = class AbstractTextMateService extends Disposable {
|
|
|
308
312
|
this._logService = _logService;
|
|
309
313
|
this._configurationService = _configurationService;
|
|
310
314
|
this._progressService = _progressService;
|
|
311
|
-
this._onDidEncounterLanguage = this._register(( new Emitter()));
|
|
315
|
+
this._onDidEncounterLanguage = this._register(( (new Emitter())));
|
|
312
316
|
this.onDidEncounterLanguage = this._onDidEncounterLanguage.event;
|
|
313
317
|
this._vscodeOniguruma = null;
|
|
314
318
|
this._styleElement = createStyleSheet();
|
|
@@ -340,7 +344,7 @@ let AbstractTextMateService = class AbstractTextMateService extends Disposable {
|
|
|
340
344
|
const grammarLocation = joinPath(extension.description.extensionLocation, grammar.path);
|
|
341
345
|
const embeddedLanguages = Object.create(null);
|
|
342
346
|
if (grammar.embeddedLanguages) {
|
|
343
|
-
const scopes = ( Object.keys(grammar.embeddedLanguages));
|
|
347
|
+
const scopes = ( (Object.keys(grammar.embeddedLanguages)));
|
|
344
348
|
for (let i = 0, len = scopes.length; i < len; i++) {
|
|
345
349
|
const scope = scopes[i];
|
|
346
350
|
const language = grammar.embeddedLanguages[scope];
|
|
@@ -354,7 +358,7 @@ let AbstractTextMateService = class AbstractTextMateService extends Disposable {
|
|
|
354
358
|
}
|
|
355
359
|
const tokenTypes = Object.create(null);
|
|
356
360
|
if (grammar.tokenTypes) {
|
|
357
|
-
const scopes = ( Object.keys(grammar.tokenTypes));
|
|
361
|
+
const scopes = ( (Object.keys(grammar.tokenTypes)));
|
|
358
362
|
for (const scope of scopes) {
|
|
359
363
|
const tokenType = grammar.tokenTypes[scope];
|
|
360
364
|
switch (tokenType) {
|
|
@@ -412,7 +416,7 @@ let AbstractTextMateService = class AbstractTextMateService extends Disposable {
|
|
|
412
416
|
}
|
|
413
417
|
startDebugMode(printFn, onStop) {
|
|
414
418
|
if (this._debugMode) {
|
|
415
|
-
this._notificationService.error(( localize('alreadyDebugging', "Already Logging.")));
|
|
419
|
+
this._notificationService.error(( (localize('alreadyDebugging', "Already Logging."))));
|
|
416
420
|
return;
|
|
417
421
|
}
|
|
418
422
|
this._debugModePrintFunc = printFn;
|
|
@@ -420,20 +424,22 @@ let AbstractTextMateService = class AbstractTextMateService extends Disposable {
|
|
|
420
424
|
if (this._debugMode) {
|
|
421
425
|
this._progressService.withProgress({
|
|
422
426
|
location: 15 ,
|
|
423
|
-
buttons: [( localize('stop', "Stop"))]
|
|
427
|
+
buttons: [( (localize('stop', "Stop")))]
|
|
424
428
|
}, (progress) => {
|
|
425
429
|
progress.report({
|
|
426
|
-
message: ( localize(
|
|
430
|
+
message: ( (localize(
|
|
427
431
|
'progress1',
|
|
428
432
|
"Preparing to log TM Grammar parsing. Press Stop when finished."
|
|
429
|
-
))
|
|
433
|
+
)))
|
|
430
434
|
});
|
|
431
435
|
return this._getVSCodeOniguruma().then((vscodeOniguruma) => {
|
|
432
436
|
vscodeOniguruma.setDefaultDebugCall(true);
|
|
433
437
|
progress.report({
|
|
434
|
-
message: ( localize('progress2', "Now logging TM Grammar parsing. Press Stop when finished."))
|
|
438
|
+
message: ( (localize('progress2', "Now logging TM Grammar parsing. Press Stop when finished.")))
|
|
435
439
|
});
|
|
436
|
-
return (
|
|
440
|
+
return (
|
|
441
|
+
(new Promise((resolve, reject) => { }))
|
|
442
|
+
);
|
|
437
443
|
});
|
|
438
444
|
}, (choice) => {
|
|
439
445
|
this._getVSCodeOniguruma().then((vscodeOniguruma) => {
|
|
@@ -460,11 +466,11 @@ let AbstractTextMateService = class AbstractTextMateService extends Disposable {
|
|
|
460
466
|
if (this._grammarFactory) {
|
|
461
467
|
return this._grammarFactory;
|
|
462
468
|
}
|
|
463
|
-
this._grammarFactory = ( new TMGrammarFactory({
|
|
469
|
+
this._grammarFactory = ( (new TMGrammarFactory({
|
|
464
470
|
logTrace: (msg) => this._logService.trace(msg),
|
|
465
471
|
logError: (msg, err) => this._logService.error(msg, err),
|
|
466
472
|
readFile: (resource) => this._extensionResourceLoaderService.readExtensionResource(resource)
|
|
467
|
-
}, this._grammarDefinitions || [], vscodeTextmate, onigLib));
|
|
473
|
+
}, this._grammarDefinitions || [], vscodeTextmate, onigLib)));
|
|
468
474
|
this._onDidCreateGrammarFactory(this._grammarDefinitions || []);
|
|
469
475
|
this._updateTheme(this._grammarFactory, this._themeService.getColorTheme(), true);
|
|
470
476
|
return this._grammarFactory;
|
|
@@ -488,7 +494,7 @@ let AbstractTextMateService = class AbstractTextMateService extends Disposable {
|
|
|
488
494
|
if (!r.grammar) {
|
|
489
495
|
return null;
|
|
490
496
|
}
|
|
491
|
-
const tokenization = ( new TMTokenization(r.grammar, r.initialState, r.containsEmbeddedLanguages));
|
|
497
|
+
const tokenization = ( (new TMTokenization(r.grammar, r.initialState, r.containsEmbeddedLanguages)));
|
|
492
498
|
tokenization.onDidEncounterLanguage((encodedLanguageId) => {
|
|
493
499
|
if (!this._encounteredLanguages[encodedLanguageId]) {
|
|
494
500
|
const languageId = this._languageService.languageIdCodec.decodeLanguageId(encodedLanguageId);
|
|
@@ -496,7 +502,9 @@ let AbstractTextMateService = class AbstractTextMateService extends Disposable {
|
|
|
496
502
|
this._onDidEncounterLanguage.fire(languageId);
|
|
497
503
|
}
|
|
498
504
|
});
|
|
499
|
-
return (
|
|
505
|
+
return (
|
|
506
|
+
(new TMTokenizationSupportWithLineLimit(languageId, encodedLanguageId, tokenization, this._configurationService))
|
|
507
|
+
);
|
|
500
508
|
}
|
|
501
509
|
catch (err) {
|
|
502
510
|
if (err.message && err.message === missingTMGrammarErrorMessage) {
|
|
@@ -511,7 +519,7 @@ let AbstractTextMateService = class AbstractTextMateService extends Disposable {
|
|
|
511
519
|
static _toColorMap(colorMap) {
|
|
512
520
|
const result = [null];
|
|
513
521
|
for (let i = 1, len = colorMap.length; i < len; i++) {
|
|
514
|
-
result[i] = ( Color.fromHex(colorMap[i]));
|
|
522
|
+
result[i] = ( (Color.fromHex(colorMap[i])));
|
|
515
523
|
}
|
|
516
524
|
return result;
|
|
517
525
|
}
|
|
@@ -555,68 +563,68 @@ let AbstractTextMateService = class AbstractTextMateService extends Disposable {
|
|
|
555
563
|
}
|
|
556
564
|
_validateGrammarExtensionPoint(extensionLocation, syntax, collector) {
|
|
557
565
|
if (syntax.language && ((typeof syntax.language !== 'string') || !this._languageService.isRegisteredLanguageId(syntax.language))) {
|
|
558
|
-
collector.error(( localize(
|
|
566
|
+
collector.error(( (localize(
|
|
559
567
|
'invalid.language',
|
|
560
568
|
"Unknown language in `contributes.{0}.language`. Provided value: {1}",
|
|
561
569
|
grammarsExtPoint.name,
|
|
562
570
|
String(syntax.language)
|
|
563
|
-
)));
|
|
571
|
+
))));
|
|
564
572
|
return false;
|
|
565
573
|
}
|
|
566
574
|
if (!syntax.scopeName || (typeof syntax.scopeName !== 'string')) {
|
|
567
|
-
collector.error(( localize(
|
|
575
|
+
collector.error(( (localize(
|
|
568
576
|
'invalid.scopeName',
|
|
569
577
|
"Expected string in `contributes.{0}.scopeName`. Provided value: {1}",
|
|
570
578
|
grammarsExtPoint.name,
|
|
571
579
|
String(syntax.scopeName)
|
|
572
|
-
)));
|
|
580
|
+
))));
|
|
573
581
|
return false;
|
|
574
582
|
}
|
|
575
583
|
if (!syntax.path || (typeof syntax.path !== 'string')) {
|
|
576
|
-
collector.error(( localize(
|
|
584
|
+
collector.error(( (localize(
|
|
577
585
|
'invalid.path.0',
|
|
578
586
|
"Expected string in `contributes.{0}.path`. Provided value: {1}",
|
|
579
587
|
grammarsExtPoint.name,
|
|
580
588
|
String(syntax.path)
|
|
581
|
-
)));
|
|
589
|
+
))));
|
|
582
590
|
return false;
|
|
583
591
|
}
|
|
584
592
|
if (syntax.injectTo && (!Array.isArray(syntax.injectTo) || syntax.injectTo.some(scope => typeof scope !== 'string'))) {
|
|
585
|
-
collector.error(( localize(
|
|
593
|
+
collector.error(( (localize(
|
|
586
594
|
'invalid.injectTo',
|
|
587
595
|
"Invalid value in `contributes.{0}.injectTo`. Must be an array of language scope names. Provided value: {1}",
|
|
588
596
|
grammarsExtPoint.name,
|
|
589
597
|
JSON.stringify(syntax.injectTo)
|
|
590
|
-
)));
|
|
598
|
+
))));
|
|
591
599
|
return false;
|
|
592
600
|
}
|
|
593
601
|
if (syntax.embeddedLanguages && !isObject(syntax.embeddedLanguages)) {
|
|
594
|
-
collector.error(( localize(
|
|
602
|
+
collector.error(( (localize(
|
|
595
603
|
'invalid.embeddedLanguages',
|
|
596
604
|
"Invalid value in `contributes.{0}.embeddedLanguages`. Must be an object map from scope name to language. Provided value: {1}",
|
|
597
605
|
grammarsExtPoint.name,
|
|
598
606
|
JSON.stringify(syntax.embeddedLanguages)
|
|
599
|
-
)));
|
|
607
|
+
))));
|
|
600
608
|
return false;
|
|
601
609
|
}
|
|
602
610
|
if (syntax.tokenTypes && !isObject(syntax.tokenTypes)) {
|
|
603
|
-
collector.error(( localize(
|
|
611
|
+
collector.error(( (localize(
|
|
604
612
|
'invalid.tokenTypes',
|
|
605
613
|
"Invalid value in `contributes.{0}.tokenTypes`. Must be an object map from scope name to token type. Provided value: {1}",
|
|
606
614
|
grammarsExtPoint.name,
|
|
607
615
|
JSON.stringify(syntax.tokenTypes)
|
|
608
|
-
)));
|
|
616
|
+
))));
|
|
609
617
|
return false;
|
|
610
618
|
}
|
|
611
619
|
const grammarLocation = joinPath(extensionLocation, syntax.path);
|
|
612
620
|
if (!isEqualOrParent(grammarLocation, extensionLocation)) {
|
|
613
|
-
collector.warn(( localize(
|
|
621
|
+
collector.warn(( (localize(
|
|
614
622
|
'invalid.path.1',
|
|
615
623
|
"Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",
|
|
616
624
|
grammarsExtPoint.name,
|
|
617
625
|
grammarLocation.path,
|
|
618
626
|
extensionLocation.path
|
|
619
|
-
)));
|
|
627
|
+
))));
|
|
620
628
|
}
|
|
621
629
|
return true;
|
|
622
630
|
}
|
|
@@ -654,15 +662,15 @@ let AbstractTextMateService = class AbstractTextMateService extends Disposable {
|
|
|
654
662
|
return vscodeOniguruma;
|
|
655
663
|
}
|
|
656
664
|
};
|
|
657
|
-
AbstractTextMateService = ( __decorate([
|
|
658
|
-
( __param(0, ILanguageService)),
|
|
659
|
-
( __param(1, IWorkbenchThemeService)),
|
|
660
|
-
( __param(2, IExtensionResourceLoaderService)),
|
|
661
|
-
( __param(3, INotificationService)),
|
|
662
|
-
( __param(4, ILogService)),
|
|
663
|
-
( __param(5, IConfigurationService)),
|
|
664
|
-
( __param(6, IProgressService))
|
|
665
|
-
], AbstractTextMateService));
|
|
665
|
+
AbstractTextMateService = ( (__decorate([
|
|
666
|
+
( (__param(0, ILanguageService))),
|
|
667
|
+
( (__param(1, IWorkbenchThemeService))),
|
|
668
|
+
( (__param(2, IExtensionResourceLoaderService))),
|
|
669
|
+
( (__param(3, INotificationService))),
|
|
670
|
+
( (__param(4, ILogService))),
|
|
671
|
+
( (__param(5, IConfigurationService))),
|
|
672
|
+
( (__param(6, IProgressService)))
|
|
673
|
+
], AbstractTextMateService)));
|
|
666
674
|
let TMTokenizationSupportWithLineLimit = class TMTokenizationSupportWithLineLimit {
|
|
667
675
|
constructor(languageId, encodedLanguageId, actual, _configurationService) {
|
|
668
676
|
this._configurationService = _configurationService;
|
|
@@ -693,9 +701,9 @@ let TMTokenizationSupportWithLineLimit = class TMTokenizationSupportWithLineLimi
|
|
|
693
701
|
return this._actual.tokenizeEncoded(line, hasEOL, state);
|
|
694
702
|
}
|
|
695
703
|
};
|
|
696
|
-
TMTokenizationSupportWithLineLimit = ( __decorate([
|
|
697
|
-
( __param(3, IConfigurationService))
|
|
698
|
-
], TMTokenizationSupportWithLineLimit));
|
|
704
|
+
TMTokenizationSupportWithLineLimit = ( (__decorate([
|
|
705
|
+
( (__param(3, IConfigurationService)))
|
|
706
|
+
], TMTokenizationSupportWithLineLimit)));
|
|
699
707
|
let TextMateService = class TextMateService extends createInjectedClass(AbstractTextMateService) {
|
|
700
708
|
constructor(loadVSCodeOnigurumWASM, instantiationService) {
|
|
701
709
|
super(instantiationService);
|
|
@@ -705,9 +713,9 @@ let TextMateService = class TextMateService extends createInjectedClass(Abstract
|
|
|
705
713
|
return this.loadVSCodeOnigurumWASM();
|
|
706
714
|
}
|
|
707
715
|
};
|
|
708
|
-
TextMateService = __decorate([
|
|
709
|
-
__param(1, IInstantiationService)
|
|
710
|
-
], TextMateService);
|
|
716
|
+
TextMateService = ( __decorate([
|
|
717
|
+
( __param(1, IInstantiationService))
|
|
718
|
+
], TextMateService));
|
|
711
719
|
const extensionPoint = getExtensionPoint('grammars');
|
|
712
720
|
function setGrammars(grammars, getContent, extension = Services.get().extension ?? DEFAULT_EXTENSION) {
|
|
713
721
|
extensionPoint.acceptUsers([{
|
|
@@ -726,7 +734,7 @@ function getServiceOverride(getOnigLib) {
|
|
|
726
734
|
onServicesInitialized(initialize);
|
|
727
735
|
return {
|
|
728
736
|
...getServiceOverride$1(),
|
|
729
|
-
[ITextMateService.toString()]: new SyncDescriptor(TextMateService, [getOnigLib])
|
|
737
|
+
[( ITextMateService.toString())]: new SyncDescriptor(TextMateService, [getOnigLib])
|
|
730
738
|
};
|
|
731
739
|
}
|
|
732
740
|
export { getServiceOverride as default, setGrammars };
|