@codingame/monaco-vscode-monarch-service-override 5.2.0 → 6.0.0
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-monarch-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@6.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import './inspectTokens.css.js';
|
|
3
3
|
import { reset, $, append } from 'vscode/vscode/vs/base/browser/dom';
|
|
4
|
+
import { CharCode } from 'vscode/vscode/vs/base/common/charCode';
|
|
4
5
|
import { Color } from 'vscode/vscode/vs/base/common/color';
|
|
6
|
+
import { KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
5
7
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
6
|
-
import {
|
|
8
|
+
import { ContentWidgetPositionPreference } from 'vscode/vscode/vs/editor/browser/editorBrowser';
|
|
9
|
+
import { EditorAction, registerEditorContribution, EditorContributionInstantiation, registerEditorAction } from 'vscode/vscode/vs/editor/browser/editorExtensions';
|
|
7
10
|
import { TokenizationRegistry } from 'vscode/vscode/vs/editor/common/languages';
|
|
8
|
-
import { TokenMetadata } from 'vscode/vscode/vs/editor/common/encodedTokenAttributes';
|
|
11
|
+
import { TokenMetadata, StandardTokenType, FontStyle } from 'vscode/vscode/vs/editor/common/encodedTokenAttributes';
|
|
9
12
|
import { NullState, nullTokenize, nullTokenizeEncoded } from 'vscode/vscode/vs/editor/common/languages/nullTokenize';
|
|
10
13
|
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
11
14
|
import { IStandaloneThemeService } from 'vscode/vscode/vs/editor/standalone/common/standaloneTheme';
|
|
@@ -26,7 +29,7 @@ let InspectTokensController = class InspectTokensController extends Disposable {
|
|
|
26
29
|
this._register(this._editor.onDidChangeModel((e) => this.stop()));
|
|
27
30
|
this._register(this._editor.onDidChangeModelLanguage((e) => this.stop()));
|
|
28
31
|
this._register(TokenizationRegistry.onDidChange((e) => this.stop()));
|
|
29
|
-
this._register(this._editor.onKeyUp((e) => e.keyCode ===
|
|
32
|
+
this._register(this._editor.onKeyUp((e) => e.keyCode === KeyCode.Escape && this.stop()));
|
|
30
33
|
}
|
|
31
34
|
dispose() {
|
|
32
35
|
this.stop();
|
|
@@ -71,10 +74,10 @@ function renderTokenText(tokenText) {
|
|
|
71
74
|
for (let charIndex = 0, len = tokenText.length; charIndex < len; charIndex++) {
|
|
72
75
|
const charCode = tokenText.charCodeAt(charIndex);
|
|
73
76
|
switch (charCode) {
|
|
74
|
-
case
|
|
77
|
+
case CharCode.Tab:
|
|
75
78
|
result += '\u2192';
|
|
76
79
|
break;
|
|
77
|
-
case
|
|
80
|
+
case CharCode.Space:
|
|
78
81
|
result += '\u00B7';
|
|
79
82
|
break;
|
|
80
83
|
default:
|
|
@@ -168,25 +171,25 @@ class InspectTokensWidget extends Disposable {
|
|
|
168
171
|
}
|
|
169
172
|
_tokenTypeToString(tokenType) {
|
|
170
173
|
switch (tokenType) {
|
|
171
|
-
case
|
|
172
|
-
case
|
|
173
|
-
case
|
|
174
|
-
case
|
|
174
|
+
case StandardTokenType.Other: return 'Other';
|
|
175
|
+
case StandardTokenType.Comment: return 'Comment';
|
|
176
|
+
case StandardTokenType.String: return 'String';
|
|
177
|
+
case StandardTokenType.RegEx: return 'RegEx';
|
|
175
178
|
default: return '??';
|
|
176
179
|
}
|
|
177
180
|
}
|
|
178
181
|
_fontStyleToString(fontStyle) {
|
|
179
182
|
let r = '';
|
|
180
|
-
if (fontStyle &
|
|
183
|
+
if (fontStyle & FontStyle.Italic) {
|
|
181
184
|
r += 'italic ';
|
|
182
185
|
}
|
|
183
|
-
if (fontStyle &
|
|
186
|
+
if (fontStyle & FontStyle.Bold) {
|
|
184
187
|
r += 'bold ';
|
|
185
188
|
}
|
|
186
|
-
if (fontStyle &
|
|
189
|
+
if (fontStyle & FontStyle.Underline) {
|
|
187
190
|
r += 'underline ';
|
|
188
191
|
}
|
|
189
|
-
if (fontStyle &
|
|
192
|
+
if (fontStyle & FontStyle.Strikethrough) {
|
|
190
193
|
r += 'strikethrough ';
|
|
191
194
|
}
|
|
192
195
|
if (r.length === 0) {
|
|
@@ -219,9 +222,9 @@ class InspectTokensWidget extends Disposable {
|
|
|
219
222
|
getPosition() {
|
|
220
223
|
return {
|
|
221
224
|
position: this._editor.getPosition(),
|
|
222
|
-
preference: [
|
|
225
|
+
preference: [ContentWidgetPositionPreference.BELOW, ContentWidgetPositionPreference.ABOVE]
|
|
223
226
|
};
|
|
224
227
|
}
|
|
225
228
|
}
|
|
226
|
-
registerEditorContribution(InspectTokensController.ID, InspectTokensController,
|
|
229
|
+
registerEditorContribution(InspectTokensController.ID, InspectTokensController, EditorContributionInstantiation.Lazy);
|
|
227
230
|
registerEditorAction(InspectTokens);
|