@codingame/monaco-vscode-monarch-service-override 11.1.2 → 12.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/index.d.ts +2 -1
- package/index.js +10 -1
- package/package.json +14 -7
- package/vscode/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.css.js +1 -1
- package/vscode/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.d.ts +1 -0
- package/vscode/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.js +20 -16
- package/vscode/src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.d.ts +1 -0
- package/vscode/src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.js +1 -0
- package/monarch.js +0 -8
package/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { type IEditorOverrideServices } from "vscode/vscode/vs/editor/standalone/browser/standaloneServices";
|
|
2
|
+
export default function getServiceOverride(): IEditorOverrideServices;
|
package/index.js
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import 'vscode/vscode/vs/editor/standalone/browser/standaloneServices';
|
|
3
|
+
import './vscode/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.js';
|
|
4
|
+
import './vscode/src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.js';
|
|
5
|
+
|
|
6
|
+
function getServiceOverride() {
|
|
7
|
+
return {};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { getServiceOverride as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-monarch-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "VSCode public API plugged on the monaco editor - monarch service-override",
|
|
4
6
|
"keywords": [],
|
|
5
7
|
"author": {
|
|
6
8
|
"name": "CodinGame",
|
|
@@ -12,8 +14,11 @@
|
|
|
12
14
|
"url": "git+ssh://git@github.com/CodinGame/monaco-vscode-api.git"
|
|
13
15
|
},
|
|
14
16
|
"type": "module",
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"vscode": "npm:@codingame/monaco-vscode-api@12.0.1"
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {},
|
|
21
|
+
"peerDependenciesMeta": {},
|
|
17
22
|
"main": "index.js",
|
|
18
23
|
"module": "index.js",
|
|
19
24
|
"types": "index.d.ts",
|
|
@@ -22,10 +27,12 @@
|
|
|
22
27
|
"default": "./index.js"
|
|
23
28
|
},
|
|
24
29
|
"./vscode/*": {
|
|
25
|
-
"default": "./vscode/src/*.js"
|
|
30
|
+
"default": "./vscode/src/*.js",
|
|
31
|
+
"types": "./vscode/src/*.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./*": {
|
|
34
|
+
"default": "./*.js",
|
|
35
|
+
"types": "./*.d.ts"
|
|
26
36
|
}
|
|
27
|
-
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@11.1.2"
|
|
30
37
|
}
|
|
31
38
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import n from 'vscode/external/rollup-plugin-styles/dist/runtime/inject-css
|
|
1
|
+
import n from 'vscode/external/rollup-plugin-styles/dist/runtime/inject-css';
|
|
2
2
|
|
|
3
3
|
var css = ".monaco-editor .tokens-inspect-widget{background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);color:var(--vscode-editorHoverWidget-foreground);padding:10px;user-select:text;-webkit-user-select:text;z-index:50}.monaco-editor.hc-black .tokens-inspect-widget,.monaco-editor.hc-light .tokens-inspect-widget{border-width:2px}.monaco-editor .tokens-inspect-widget .tokens-inspect-separator{background-color:var(--vscode-editorHoverWidget-border);border:0;height:1px}.monaco-editor .tokens-inspect-widget .tm-token{font-family:var(--monaco-monospace-font)}.monaco-editor .tokens-inspect-widget .tm-token-length{float:right;font-size:60%;font-weight:400}.monaco-editor .tokens-inspect-widget .tm-metadata-table{width:100%}.monaco-editor .tokens-inspect-widget .tm-metadata-value{font-family:var(--monaco-monospace-font);text-align:right}.monaco-editor .tokens-inspect-widget .tm-token-type{font-family:var(--monaco-monospace-font)}";
|
|
4
4
|
n(css,{});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import './inspectTokens.css.js';
|
|
3
4
|
import { reset, $, append } from 'vscode/vscode/vs/base/browser/dom';
|
|
5
|
+
import { CharCode } from 'vscode/vscode/vs/base/common/charCode';
|
|
4
6
|
import { Color } from 'vscode/vscode/vs/base/common/color';
|
|
7
|
+
import { KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
5
8
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
6
|
-
import {
|
|
9
|
+
import { ContentWidgetPositionPreference } from 'vscode/vscode/vs/editor/browser/editorBrowser';
|
|
10
|
+
import { EditorAction, registerEditorContribution, EditorContributionInstantiation, registerEditorAction } from 'vscode/vscode/vs/editor/browser/editorExtensions';
|
|
7
11
|
import { TokenizationRegistry } from 'vscode/vscode/vs/editor/common/languages';
|
|
8
|
-
import { TokenMetadata } from 'vscode/vscode/vs/editor/common/encodedTokenAttributes';
|
|
12
|
+
import { TokenMetadata, StandardTokenType, FontStyle } from 'vscode/vscode/vs/editor/common/encodedTokenAttributes';
|
|
9
13
|
import { NullState, nullTokenize, nullTokenizeEncoded } from 'vscode/vscode/vs/editor/common/languages/nullTokenize';
|
|
10
14
|
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
11
15
|
import { IStandaloneThemeService } from 'vscode/vscode/vs/editor/standalone/common/standaloneTheme';
|
|
@@ -26,7 +30,7 @@ let InspectTokensController = class InspectTokensController extends Disposable {
|
|
|
26
30
|
this._register(this._editor.onDidChangeModel((e) => this.stop()));
|
|
27
31
|
this._register(this._editor.onDidChangeModelLanguage((e) => this.stop()));
|
|
28
32
|
this._register(TokenizationRegistry.onDidChange((e) => this.stop()));
|
|
29
|
-
this._register(this._editor.onKeyUp((e) => e.keyCode ===
|
|
33
|
+
this._register(this._editor.onKeyUp((e) => e.keyCode === KeyCode.Escape && this.stop()));
|
|
30
34
|
}
|
|
31
35
|
dispose() {
|
|
32
36
|
this.stop();
|
|
@@ -71,10 +75,10 @@ function renderTokenText(tokenText) {
|
|
|
71
75
|
for (let charIndex = 0, len = tokenText.length; charIndex < len; charIndex++) {
|
|
72
76
|
const charCode = tokenText.charCodeAt(charIndex);
|
|
73
77
|
switch (charCode) {
|
|
74
|
-
case
|
|
78
|
+
case CharCode.Tab:
|
|
75
79
|
result += '\u2192';
|
|
76
80
|
break;
|
|
77
|
-
case
|
|
81
|
+
case CharCode.Space:
|
|
78
82
|
result += '\u00B7';
|
|
79
83
|
break;
|
|
80
84
|
default:
|
|
@@ -168,25 +172,25 @@ class InspectTokensWidget extends Disposable {
|
|
|
168
172
|
}
|
|
169
173
|
_tokenTypeToString(tokenType) {
|
|
170
174
|
switch (tokenType) {
|
|
171
|
-
case
|
|
172
|
-
case
|
|
173
|
-
case
|
|
174
|
-
case
|
|
175
|
+
case StandardTokenType.Other: return 'Other';
|
|
176
|
+
case StandardTokenType.Comment: return 'Comment';
|
|
177
|
+
case StandardTokenType.String: return 'String';
|
|
178
|
+
case StandardTokenType.RegEx: return 'RegEx';
|
|
175
179
|
default: return '??';
|
|
176
180
|
}
|
|
177
181
|
}
|
|
178
182
|
_fontStyleToString(fontStyle) {
|
|
179
183
|
let r = '';
|
|
180
|
-
if (fontStyle &
|
|
184
|
+
if (fontStyle & FontStyle.Italic) {
|
|
181
185
|
r += 'italic ';
|
|
182
186
|
}
|
|
183
|
-
if (fontStyle &
|
|
187
|
+
if (fontStyle & FontStyle.Bold) {
|
|
184
188
|
r += 'bold ';
|
|
185
189
|
}
|
|
186
|
-
if (fontStyle &
|
|
190
|
+
if (fontStyle & FontStyle.Underline) {
|
|
187
191
|
r += 'underline ';
|
|
188
192
|
}
|
|
189
|
-
if (fontStyle &
|
|
193
|
+
if (fontStyle & FontStyle.Strikethrough) {
|
|
190
194
|
r += 'strikethrough ';
|
|
191
195
|
}
|
|
192
196
|
if (r.length === 0) {
|
|
@@ -219,9 +223,9 @@ class InspectTokensWidget extends Disposable {
|
|
|
219
223
|
getPosition() {
|
|
220
224
|
return {
|
|
221
225
|
position: this._editor.getPosition(),
|
|
222
|
-
preference: [
|
|
226
|
+
preference: [ContentWidgetPositionPreference.BELOW, ContentWidgetPositionPreference.ABOVE]
|
|
223
227
|
};
|
|
224
228
|
}
|
|
225
229
|
}
|
|
226
|
-
registerEditorContribution(InspectTokensController.ID, InspectTokensController,
|
|
230
|
+
registerEditorContribution(InspectTokensController.ID, InspectTokensController, EditorContributionInstantiation.Lazy);
|
|
227
231
|
registerEditorAction(InspectTokens);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
import { EditorAction, registerEditorAction } from 'vscode/vscode/vs/editor/browser/editorExtensions';
|
|
2
3
|
import { IStandaloneThemeService } from 'vscode/vscode/vs/editor/standalone/common/standaloneTheme';
|
|
3
4
|
import { ToggleHighContrastNLS } from 'vscode/vscode/vs/editor/common/standaloneStrings';
|
package/monarch.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import './vscode/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.js';
|
|
2
|
-
import './vscode/src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.js';
|
|
3
|
-
|
|
4
|
-
function getServiceOverride() {
|
|
5
|
-
return {};
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export { getServiceOverride as default };
|