@codingame/monaco-vscode-editor-api 5.3.0 → 6.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/esm/vs/editor/editor.api.js +20 -13
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigurationChangedEvent, ApplyUpdateResult, EditorOptions } from 'vscode/vscode/vs/editor/common/config/editorOptions';
|
|
1
|
+
import { ConfigurationChangedEvent, ApplyUpdateResult, EditorOptions, WrappingIndent as WrappingIndent$1, EditorAutoIndentStrategy as EditorAutoIndentStrategy$1 } from 'vscode/vscode/vs/editor/common/config/editorOptions';
|
|
2
2
|
import { createMonacoBaseAPI } from 'vscode/vscode/vs/editor/common/services/editorBaseApi';
|
|
3
3
|
import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
|
|
4
4
|
import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
@@ -21,6 +21,7 @@ import { TextModelResolvedOptions, FindMatch } from 'vscode/vscode/vs/editor/com
|
|
|
21
21
|
import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
|
|
22
22
|
import { AccessibilitySupport, ContentWidgetPositionPreference, CursorChangeReason, DefaultEndOfLine, EditorAutoIndentStrategy, EditorOption, EndOfLinePreference, EndOfLineSequence, MinimapPosition, MinimapSectionHeaderStyle, MouseTargetType, OverlayWidgetPositionPreference, OverviewRulerLane, GlyphMarginLane, RenderLineNumbersType, RenderMinimap, ScrollbarVisibility, ScrollType, TextEditorCursorBlinkingStyle, TextEditorCursorStyle, TrackedRangeStickiness, WrappingIndent, InjectedTextCursorStops, PositionAffinity, ShowLightbulbIconMode, DocumentHighlightKind, CompletionItemKind, CompletionItemTag, CompletionItemInsertTextRule, SymbolKind, SymbolTag, IndentAction, CompletionTriggerKind, SignatureHelpTriggerKind, InlayHintKind, InlineCompletionTriggerKind, InlineEditTriggerKind, CodeActionTriggerType, NewSymbolNameTag, NewSymbolNameTriggerKind, PartialAcceptTriggerKind, HoverVerbosityAction } from 'vscode/vscode/vs/editor/common/standalone/standaloneEnums';
|
|
23
23
|
import { createTrustedTypesPolicy } from 'vscode/vscode/vs/base/browser/trustedTypes';
|
|
24
|
+
import { LanguageId, MetadataConsts, FontStyle, ColorId } from 'vscode/vscode/vs/editor/common/encodedTokenAttributes';
|
|
24
25
|
import { LineTokens } from 'vscode/vscode/vs/editor/common/tokens/lineTokens';
|
|
25
26
|
import { renderViewLine2, RenderLineInput } from 'vscode/vscode/vs/editor/common/viewLayout/viewLineRenderer';
|
|
26
27
|
import { ViewLineRenderingData } from 'vscode/vscode/vs/editor/common/viewModel';
|
|
@@ -46,6 +47,12 @@ import { withReadyServices } from 'vscode/services';
|
|
|
46
47
|
var css = ".monaco-editor.standalone{--monaco-monospace-font:\"SF Mono\",Monaco,Menlo,Consolas,\"Ubuntu Mono\",\"Liberation Mono\",\"DejaVu Sans Mono\",\"Courier New\",monospace;font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,system-ui,Ubuntu,Droid Sans,sans-serif}.monaco-editor.standalone.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.standalone.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.standalone.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-hover p{margin:0}.monaco-aria-container{clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute!important;top:0;width:1px}.monaco-diff-editor.standalone .synthetic-focus,.monaco-diff-editor.standalone [tabindex=\"-1\"]:focus,.monaco-diff-editor.standalone [tabindex=\"0\"]:focus,.monaco-diff-editor.standalone button:focus,.monaco-diff-editor.standalone input[type=button]:focus,.monaco-diff-editor.standalone input[type=checkbox]:focus,.monaco-diff-editor.standalone input[type=search]:focus,.monaco-diff-editor.standalone input[type=text]:focus,.monaco-diff-editor.standalone select:focus,.monaco-diff-editor.standalone textarea:focus,.monaco-editor.standalone .synthetic-focus,.monaco-editor.standalone [tabindex=\"-1\"]:focus,.monaco-editor.standalone [tabindex=\"0\"]:focus,.monaco-editor.standalone button:focus,.monaco-editor.standalone input[type=button]:focus,.monaco-editor.standalone input[type=checkbox]:focus,.monaco-editor.standalone input[type=search]:focus,.monaco-editor.standalone input[type=text]:focus,.monaco-editor.standalone select:focus,.monaco-editor.standalone textarea:focus{opacity:1;outline-color:var(--vscode-focusBorder);outline-offset:-1px;outline-style:solid;outline-width:1px}";
|
|
47
48
|
n(css,{});
|
|
48
49
|
|
|
50
|
+
var MonarchBracket;
|
|
51
|
+
( (function(MonarchBracket) {
|
|
52
|
+
MonarchBracket[MonarchBracket["None"] = 0] = "None";
|
|
53
|
+
MonarchBracket[MonarchBracket["Open"] = 1] = "Open";
|
|
54
|
+
MonarchBracket[MonarchBracket["Close"] = -1] = "Close";
|
|
55
|
+
})(MonarchBracket || (MonarchBracket = {})));
|
|
49
56
|
function isFuzzyActionArr(what) {
|
|
50
57
|
return (Array.isArray(what));
|
|
51
58
|
}
|
|
@@ -352,14 +359,14 @@ class MonarchModernTokensCollector {
|
|
|
352
359
|
this._theme = theme;
|
|
353
360
|
this._prependTokens = null;
|
|
354
361
|
this._tokens = [];
|
|
355
|
-
this._currentLanguageId =
|
|
362
|
+
this._currentLanguageId = LanguageId.Null;
|
|
356
363
|
this._lastTokenMetadata = 0;
|
|
357
364
|
}
|
|
358
365
|
enterLanguage(languageId) {
|
|
359
366
|
this._currentLanguageId = this._languageService.languageIdCodec.encodeLanguageId(languageId);
|
|
360
367
|
}
|
|
361
368
|
emit(startOffset, type) {
|
|
362
|
-
const metadata = this._theme.match(this._currentLanguageId, type) |
|
|
369
|
+
const metadata = this._theme.match(this._currentLanguageId, type) | MetadataConsts.BALANCED_BRACKETS_MASK;
|
|
363
370
|
if (this._lastTokenMetadata === metadata) {
|
|
364
371
|
return;
|
|
365
372
|
}
|
|
@@ -836,10 +843,10 @@ function findBracket(lexer, matched) {
|
|
|
836
843
|
const brackets = lexer.brackets;
|
|
837
844
|
for (const bracket of brackets) {
|
|
838
845
|
if (bracket.open === matched) {
|
|
839
|
-
return { token: bracket.token, bracketType:
|
|
846
|
+
return { token: bracket.token, bracketType: MonarchBracket.Open };
|
|
840
847
|
}
|
|
841
848
|
else if (bracket.close === matched) {
|
|
842
|
-
return { token: bracket.token, bracketType:
|
|
849
|
+
return { token: bracket.token, bracketType: MonarchBracket.Close };
|
|
843
850
|
}
|
|
844
851
|
}
|
|
845
852
|
return null;
|
|
@@ -936,9 +943,9 @@ function _colorize(lines, tabSize, tokenizationSupport, languageIdCodec) {
|
|
|
936
943
|
}
|
|
937
944
|
function _fakeColorize(lines, tabSize, languageIdCodec) {
|
|
938
945
|
let html = [];
|
|
939
|
-
const defaultMetadata = ((
|
|
940
|
-
| (
|
|
941
|
-
| (
|
|
946
|
+
const defaultMetadata = ((FontStyle.None << MetadataConsts.FONT_STYLE_OFFSET)
|
|
947
|
+
| (ColorId.DefaultForeground << MetadataConsts.FOREGROUND_OFFSET)
|
|
948
|
+
| (ColorId.DefaultBackground << MetadataConsts.BACKGROUND_OFFSET)) >>> 0;
|
|
942
949
|
const tokens = ( new Uint32Array(2));
|
|
943
950
|
tokens[0] = 0;
|
|
944
951
|
tokens[1] = defaultMetadata;
|
|
@@ -1541,10 +1548,10 @@ function compileAction(lexer, ruleName, action) {
|
|
|
1541
1548
|
}
|
|
1542
1549
|
if (typeof (action.bracket) === 'string') {
|
|
1543
1550
|
if (action.bracket === '@open') {
|
|
1544
|
-
newAction.bracket =
|
|
1551
|
+
newAction.bracket = MonarchBracket.Open;
|
|
1545
1552
|
}
|
|
1546
1553
|
else if (action.bracket === '@close') {
|
|
1547
|
-
newAction.bracket =
|
|
1554
|
+
newAction.bracket = MonarchBracket.Close;
|
|
1548
1555
|
}
|
|
1549
1556
|
else {
|
|
1550
1557
|
throw createError(lexer, 'a \'bracket\' attribute must be either \'@open\' or \'@close\', in rule: ' + ruleName);
|
|
@@ -1910,7 +1917,7 @@ class TokenizationSupportAdapter {
|
|
|
1910
1917
|
let previousStartIndex = 0;
|
|
1911
1918
|
for (let i = 0, len = tokens.length; i < len; i++) {
|
|
1912
1919
|
const t = tokens[i];
|
|
1913
|
-
const metadata = tokenTheme.match(languageId, t.scopes) |
|
|
1920
|
+
const metadata = tokenTheme.match(languageId, t.scopes) | MetadataConsts.BALANCED_BRACKETS_MASK;
|
|
1914
1921
|
if (resultLen > 0 && result[resultLen - 1] === metadata) {
|
|
1915
1922
|
continue;
|
|
1916
1923
|
}
|
|
@@ -2219,9 +2226,9 @@ function createMonacoLanguagesAPI() {
|
|
|
2219
2226
|
};
|
|
2220
2227
|
}
|
|
2221
2228
|
|
|
2222
|
-
EditorOptions.wrappingIndent.defaultValue =
|
|
2229
|
+
EditorOptions.wrappingIndent.defaultValue = WrappingIndent$1.None;
|
|
2223
2230
|
EditorOptions.glyphMargin.defaultValue = false;
|
|
2224
|
-
EditorOptions.autoIndent.defaultValue =
|
|
2231
|
+
EditorOptions.autoIndent.defaultValue = EditorAutoIndentStrategy$1.Advanced;
|
|
2225
2232
|
EditorOptions.overviewRulerLanes.defaultValue = 2;
|
|
2226
2233
|
FormattingConflicts.setFormatterSelector((formatter, document, mode) => Promise.resolve(formatter[0]));
|
|
2227
2234
|
const api = createMonacoBaseAPI();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-editor-api",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
"module": "esm/vs/editor/editor.api.js",
|
|
50
50
|
"types": "esm/vs/editor/editor.api.d.ts",
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
52
|
+
"vscode": "npm:@codingame/monaco-vscode-api@6.0.1"
|
|
53
53
|
}
|
|
54
54
|
}
|