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