@codingame/monaco-vscode-textmate-service-override 37.2.0 → 37.3.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/textMateWorkerTokenizerController.js +11 -7
- package/vscode/src/vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.worker.js +2 -2
- package/vscode/src/vs/workbench/services/textMate/browser/indexTransformer.js +1 -1
- package/vscode/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.js +11 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-textmate-service-override",
|
|
3
|
-
"version": "37.
|
|
3
|
+
"version": "37.3.1",
|
|
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": "37.
|
|
19
|
-
"@codingame/monaco-vscode-files-service-override": "37.
|
|
18
|
+
"@codingame/monaco-vscode-api": "37.3.1",
|
|
19
|
+
"@codingame/monaco-vscode-files-service-override": "37.3.1"
|
|
20
20
|
},
|
|
21
21
|
"main": "index.js",
|
|
22
22
|
"module": "index.js",
|
|
@@ -91,12 +91,12 @@ class TextMateWorkerTokenizerController extends Disposable {
|
|
|
91
91
|
if (this._shouldLog) {
|
|
92
92
|
console.log("received background tokenization result", {
|
|
93
93
|
fileName: this._model.uri.fsPath.split("\\").pop(),
|
|
94
|
-
updatedTokenLines:
|
|
95
|
-
updatedStateLines:
|
|
94
|
+
updatedTokenLines: tokens.map(t => t.getLineRange()).join(" & "),
|
|
95
|
+
updatedStateLines: stateDeltas.map(s => ( ( new LineRange(s.startLineNumber, s.startLineNumber + s.stateDeltas.length)).toString())).join(" & ")
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
if (this._shouldLog) {
|
|
99
|
-
const changes =
|
|
99
|
+
const changes = this._pendingChanges.filter(c => c.versionId <= versionId).map(c => c.changes).map(c => changesToString(c)).join(" then ");
|
|
100
100
|
console.log("Applying changes to local states", changes);
|
|
101
101
|
}
|
|
102
102
|
while (this._pendingChanges.length > 0 && this._pendingChanges[0].versionId <= versionId) {
|
|
@@ -105,10 +105,12 @@ class TextMateWorkerTokenizerController extends Disposable {
|
|
|
105
105
|
}
|
|
106
106
|
if (this._pendingChanges.length > 0) {
|
|
107
107
|
if (this._shouldLog) {
|
|
108
|
-
const changes =
|
|
108
|
+
const changes = this._pendingChanges.map(c => c.changes).map(c => changesToString(c)).join(" then ");
|
|
109
109
|
console.log("Considering non-processed changes", changes);
|
|
110
110
|
}
|
|
111
|
-
const curToFutureTransformerTokens = MonotonousIndexTransformer.fromMany(
|
|
111
|
+
const curToFutureTransformerTokens = MonotonousIndexTransformer.fromMany(
|
|
112
|
+
this._pendingChanges.map(c => linesLengthEditFromModelContentChange(c.changes))
|
|
113
|
+
);
|
|
112
114
|
const b = ( new ContiguousMultilineTokensBuilder());
|
|
113
115
|
for (const t of tokens) {
|
|
114
116
|
for (let i = t.startLineNumber; i <= t.endLineNumber; i++) {
|
|
@@ -128,7 +130,9 @@ class TextMateWorkerTokenizerController extends Disposable {
|
|
|
128
130
|
}
|
|
129
131
|
fontTokensUpdate.rebase(this._stringEditFromChanges(this._model, this._pendingChanges));
|
|
130
132
|
}
|
|
131
|
-
const curToFutureTransformerStates = MonotonousIndexTransformer.fromMany(
|
|
133
|
+
const curToFutureTransformerStates = MonotonousIndexTransformer.fromMany(
|
|
134
|
+
this._pendingChanges.map(c => linesLengthEditFromModelContentChange(c.changes))
|
|
135
|
+
);
|
|
132
136
|
if (!this._applyStateStackDiffFn || !this._initialState) {
|
|
133
137
|
const {
|
|
134
138
|
applyStateStackDiff,
|
|
@@ -179,7 +183,7 @@ class TextMateWorkerTokenizerController extends Disposable {
|
|
|
179
183
|
}
|
|
180
184
|
}
|
|
181
185
|
function changesToString(changes) {
|
|
182
|
-
return
|
|
186
|
+
return changes.map(c => ( Range.lift(c.range).toString()) + " => " + c.text).join(" & ");
|
|
183
187
|
}
|
|
184
188
|
|
|
185
189
|
export { TextMateWorkerTokenizerController };
|
|
@@ -16,7 +16,7 @@ class TextMateTokenizationWorker {
|
|
|
16
16
|
this._host = TextMateWorkerHost.getChannel(workerServer);
|
|
17
17
|
}
|
|
18
18
|
async $init(_createData) {
|
|
19
|
-
const grammarDefinitions =
|
|
19
|
+
const grammarDefinitions = _createData.grammarDefinitions.map(def => {
|
|
20
20
|
return {
|
|
21
21
|
location: URI.revive(def.location),
|
|
22
22
|
language: def.language,
|
|
@@ -28,7 +28,7 @@ class TextMateTokenizationWorker {
|
|
|
28
28
|
unbalancedBracketSelectors: def.unbalancedBracketSelectors,
|
|
29
29
|
sourceExtensionId: def.sourceExtensionId
|
|
30
30
|
};
|
|
31
|
-
})
|
|
31
|
+
});
|
|
32
32
|
this._grammarFactory = this._loadTMGrammarFactory(grammarDefinitions, _createData.onigurumaWASMUri);
|
|
33
33
|
}
|
|
34
34
|
async _loadTMGrammarFactory(grammarDefinitions, onigurumaWASMUri) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
class MonotonousIndexTransformer {
|
|
4
4
|
static fromMany(transformations) {
|
|
5
|
-
const transformers =
|
|
5
|
+
const transformers = transformations.map(t => ( new MonotonousIndexTransformer(t)));
|
|
6
6
|
return ( new CombinedIndexTransformer(transformers));
|
|
7
7
|
}
|
|
8
8
|
constructor(transformation) {
|
package/vscode/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.js
CHANGED
|
@@ -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(22174, "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(22175, "Stop"))]
|
|
209
209
|
}, progress => {
|
|
210
210
|
progress.report({
|
|
211
|
-
message: ( localize(
|
|
211
|
+
message: ( localize(22176, "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(22177, "Now logging TM Grammar parsing. Press Stop when finished."))
|
|
217
217
|
});
|
|
218
218
|
return ( new Promise((resolve, reject) => {}));
|
|
219
219
|
});
|
|
@@ -426,7 +426,7 @@ function equalsTokenRules(a, b) {
|
|
|
426
426
|
function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _languageService) {
|
|
427
427
|
if (syntax.language && ((typeof syntax.language !== "string") || !_languageService.isRegisteredLanguageId(syntax.language))) {
|
|
428
428
|
collector.error(( localize(
|
|
429
|
-
|
|
429
|
+
22178,
|
|
430
430
|
"Unknown language in `contributes.{0}.language`. Provided value: {1}",
|
|
431
431
|
grammarsExtPoint.name,
|
|
432
432
|
String(syntax.language)
|
|
@@ -435,7 +435,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
435
435
|
}
|
|
436
436
|
if (!syntax.scopeName || (typeof syntax.scopeName !== "string")) {
|
|
437
437
|
collector.error(( localize(
|
|
438
|
-
|
|
438
|
+
22179,
|
|
439
439
|
"Expected string in `contributes.{0}.scopeName`. Provided value: {1}",
|
|
440
440
|
grammarsExtPoint.name,
|
|
441
441
|
String(syntax.scopeName)
|
|
@@ -444,7 +444,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
444
444
|
}
|
|
445
445
|
if (!syntax.path || (typeof syntax.path !== "string")) {
|
|
446
446
|
collector.error(( localize(
|
|
447
|
-
|
|
447
|
+
22180,
|
|
448
448
|
"Expected string in `contributes.{0}.path`. Provided value: {1}",
|
|
449
449
|
grammarsExtPoint.name,
|
|
450
450
|
String(syntax.path)
|
|
@@ -453,7 +453,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
453
453
|
}
|
|
454
454
|
if (syntax.injectTo && (!Array.isArray(syntax.injectTo) || ( syntax.injectTo.some(scope => typeof scope !== "string")))) {
|
|
455
455
|
collector.error(( localize(
|
|
456
|
-
|
|
456
|
+
22181,
|
|
457
457
|
"Invalid value in `contributes.{0}.injectTo`. Must be an array of language scope names. Provided value: {1}",
|
|
458
458
|
grammarsExtPoint.name,
|
|
459
459
|
JSON.stringify(syntax.injectTo)
|
|
@@ -462,7 +462,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
462
462
|
}
|
|
463
463
|
if (syntax.embeddedLanguages && !isObject(syntax.embeddedLanguages)) {
|
|
464
464
|
collector.error(( localize(
|
|
465
|
-
|
|
465
|
+
22182,
|
|
466
466
|
"Invalid value in `contributes.{0}.embeddedLanguages`. Must be an object map from scope name to language. Provided value: {1}",
|
|
467
467
|
grammarsExtPoint.name,
|
|
468
468
|
JSON.stringify(syntax.embeddedLanguages)
|
|
@@ -471,7 +471,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
471
471
|
}
|
|
472
472
|
if (syntax.tokenTypes && !isObject(syntax.tokenTypes)) {
|
|
473
473
|
collector.error(( localize(
|
|
474
|
-
|
|
474
|
+
22183,
|
|
475
475
|
"Invalid value in `contributes.{0}.tokenTypes`. Must be an object map from scope name to token type. Provided value: {1}",
|
|
476
476
|
grammarsExtPoint.name,
|
|
477
477
|
JSON.stringify(syntax.tokenTypes)
|
|
@@ -481,7 +481,7 @@ function validateGrammarExtensionPoint(extensionLocation, syntax, collector, _la
|
|
|
481
481
|
const grammarLocation = joinPath(extensionLocation, syntax.path);
|
|
482
482
|
if (!isEqualOrParent(grammarLocation, extensionLocation)) {
|
|
483
483
|
collector.warn(( localize(
|
|
484
|
-
|
|
484
|
+
22184,
|
|
485
485
|
"Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",
|
|
486
486
|
grammarsExtPoint.name,
|
|
487
487
|
grammarLocation.path,
|