@codingame/monaco-vscode-editor-api 19.1.4 → 20.0.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/editor/standalone/browser/colorizer.js +9 -3
- package/vscode/src/vs/editor/standalone/browser/standaloneEditor.js +2 -1
- package/vscode/src/vs/editor/standalone/browser/standaloneWebWorker.d.ts +1 -1
- package/vscode/src/vs/editor/standalone/browser/standaloneWebWorker.js +3 -0
- package/vscode/src/vs/editor/standalone/common/monarch/monarchCommon.d.ts +1 -0
- package/vscode/src/vs/editor/standalone/common/monarch/monarchCommon.js +2 -1
- package/vscode/src/vs/editor/standalone/common/monarch/monarchCompile.js +6 -0
- package/vscode/src/vs/editor/standalone/common/monarch/monarchLexer.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-editor-api",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - monaco-editor compatible api",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-5452e2b7-9081-5f95-839b-4ab3544ce28f-common": "
|
|
19
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-5452e2b7-9081-5f95-839b-4ab3544ce28f-common": "20.0.1",
|
|
19
|
+
"@codingame/monaco-vscode-api": "20.0.1"
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
22
22
|
".": "./esm/vs/editor/editor.api.js",
|
|
@@ -69,7 +69,9 @@ class Colorizer {
|
|
|
69
69
|
'none',
|
|
70
70
|
false,
|
|
71
71
|
false,
|
|
72
|
-
null
|
|
72
|
+
null,
|
|
73
|
+
null,
|
|
74
|
+
0
|
|
73
75
|
)));
|
|
74
76
|
return renderResult.html;
|
|
75
77
|
}
|
|
@@ -130,7 +132,9 @@ function _fakeColorize(lines, tabSize, languageIdCodec) {
|
|
|
130
132
|
'none',
|
|
131
133
|
false,
|
|
132
134
|
false,
|
|
133
|
-
null
|
|
135
|
+
null,
|
|
136
|
+
null,
|
|
137
|
+
0
|
|
134
138
|
)));
|
|
135
139
|
html = html.concat(renderResult.html);
|
|
136
140
|
html.push('<br/>');
|
|
@@ -166,7 +170,9 @@ function _actualColorize(lines, tabSize, tokenizationSupport, languageIdCodec) {
|
|
|
166
170
|
'none',
|
|
167
171
|
false,
|
|
168
172
|
false,
|
|
169
|
-
null
|
|
173
|
+
null,
|
|
174
|
+
null,
|
|
175
|
+
0
|
|
170
176
|
)));
|
|
171
177
|
html = html.concat(renderResult.html);
|
|
172
178
|
html.push('<br/>');
|
|
@@ -19,7 +19,7 @@ import { PLAINTEXT_LANGUAGE_ID } from '@codingame/monaco-vscode-api/vscode/vs/ed
|
|
|
19
19
|
import { nullTokenize, NullState } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/nullTokenize';
|
|
20
20
|
import { FindMatch, TextModelResolvedOptions } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model';
|
|
21
21
|
import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
|
|
22
|
-
import { ShowLightbulbIconMode, PositionAffinity, InjectedTextCursorStops, WrappingIndent, TrackedRangeStickiness, TextEditorCursorStyle, TextEditorCursorBlinkingStyle, ScrollType, ScrollbarVisibility, RenderMinimap, RenderLineNumbersType, GlyphMarginLane, OverviewRulerLane, OverlayWidgetPositionPreference, MouseTargetType, MinimapSectionHeaderStyle, MinimapPosition, EndOfLineSequence, EndOfLinePreference, EditorOption, EditorAutoIndentStrategy, DefaultEndOfLine, CursorChangeReason, ContentWidgetPositionPreference, AccessibilitySupport } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/standalone/standaloneEnums';
|
|
22
|
+
import { TextDirection, ShowLightbulbIconMode, PositionAffinity, InjectedTextCursorStops, WrappingIndent, TrackedRangeStickiness, TextEditorCursorStyle, TextEditorCursorBlinkingStyle, ScrollType, ScrollbarVisibility, RenderMinimap, RenderLineNumbersType, GlyphMarginLane, OverviewRulerLane, OverlayWidgetPositionPreference, MouseTargetType, MinimapSectionHeaderStyle, MinimapPosition, EndOfLineSequence, EndOfLinePreference, EditorOption, EditorAutoIndentStrategy, DefaultEndOfLine, CursorChangeReason, ContentWidgetPositionPreference, AccessibilitySupport } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/standalone/standaloneEnums';
|
|
23
23
|
import { Colorizer } from './colorizer.js';
|
|
24
24
|
import { StandaloneEditor, StandaloneDiffEditor2, createTextModel } from '@codingame/monaco-vscode-api/vscode/vs/editor/standalone/browser/standaloneCodeEditor';
|
|
25
25
|
import { StandaloneServices, StandaloneKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/editor/standalone/browser/standaloneServices';
|
|
@@ -333,6 +333,7 @@ function createMonacoEditorAPI() {
|
|
|
333
333
|
InjectedTextCursorStops: InjectedTextCursorStops,
|
|
334
334
|
PositionAffinity: PositionAffinity,
|
|
335
335
|
ShowLightbulbIconMode: ShowLightbulbIconMode,
|
|
336
|
+
TextDirection: TextDirection,
|
|
336
337
|
ConfigurationChangedEvent: ConfigurationChangedEvent,
|
|
337
338
|
BareFontInfo: BareFontInfo,
|
|
338
339
|
FontInfo: FontInfo,
|
|
@@ -11,6 +11,9 @@ class MonacoWebWorkerImpl extends EditorWorkerClient {
|
|
|
11
11
|
this._foreignProxy = this._getProxy().then(proxy => {
|
|
12
12
|
return ( new Proxy({}, {
|
|
13
13
|
get(target, prop, receiver) {
|
|
14
|
+
if (prop === 'then') {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
14
17
|
if (typeof prop !== 'string') {
|
|
15
18
|
throw ( new Error(`Not supported`));
|
|
16
19
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
|
|
2
|
+
import { escapeRegExpCharacters } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
2
3
|
|
|
3
4
|
var MonarchBracket;
|
|
4
5
|
(function (MonarchBracket) {
|
|
@@ -68,7 +69,7 @@ function substituteMatchesRe(lexer, str, state) {
|
|
|
68
69
|
stateMatches.unshift(state);
|
|
69
70
|
}
|
|
70
71
|
if (!empty(s) && s < stateMatches.length) {
|
|
71
|
-
return fixCase(lexer, stateMatches[s]);
|
|
72
|
+
return escapeRegExpCharacters(fixCase(lexer, stateMatches[s]));
|
|
72
73
|
}
|
|
73
74
|
return '';
|
|
74
75
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
|
|
2
|
+
import { isString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
2
3
|
import { createError, empty, substituteMatchesRe, substituteMatches, fixCase, MonarchBracket, stateExists } from './monarchCommon.js';
|
|
3
4
|
|
|
4
5
|
function isArrayOf(elemType, obj) {
|
|
@@ -270,6 +271,7 @@ function compileAction(lexer, ruleName, action) {
|
|
|
270
271
|
}
|
|
271
272
|
else if (action.cases) {
|
|
272
273
|
const cases = [];
|
|
274
|
+
let hasEmbeddedEndInCases = false;
|
|
273
275
|
for (const tkey in action.cases) {
|
|
274
276
|
if (action.cases.hasOwnProperty(tkey)) {
|
|
275
277
|
const val = compileAction(lexer, ruleName, action.cases[tkey]);
|
|
@@ -282,10 +284,14 @@ function compileAction(lexer, ruleName, action) {
|
|
|
282
284
|
else {
|
|
283
285
|
cases.push(createGuard(lexer, ruleName, tkey, val));
|
|
284
286
|
}
|
|
287
|
+
if (!hasEmbeddedEndInCases) {
|
|
288
|
+
hasEmbeddedEndInCases = !isString(val) && (val.hasEmbeddedEndInCases || ['@pop', '@popall'].includes(val.nextEmbedded || ''));
|
|
289
|
+
}
|
|
285
290
|
}
|
|
286
291
|
}
|
|
287
292
|
const def = lexer.defaultToken;
|
|
288
293
|
return {
|
|
294
|
+
hasEmbeddedEndInCases,
|
|
289
295
|
test: function (id, matches, state, eos) {
|
|
290
296
|
for (const _case of cases) {
|
|
291
297
|
const didmatch = (!_case.test || _case.test(id, matches, state, eos));
|
|
@@ -385,7 +385,7 @@ let MonarchTokenizer = MonarchTokenizer_1 = class MonarchTokenizer extends Dispo
|
|
|
385
385
|
let popOffset = -1;
|
|
386
386
|
let hasEmbeddedPopRule = false;
|
|
387
387
|
for (const rule of rules) {
|
|
388
|
-
if (!isIAction(rule.action) || rule.action.nextEmbedded
|
|
388
|
+
if (!isIAction(rule.action) || !(rule.action.nextEmbedded === '@pop' || rule.action.hasEmbeddedEndInCases)) {
|
|
389
389
|
continue;
|
|
390
390
|
}
|
|
391
391
|
hasEmbeddedPopRule = true;
|