@theia/monaco 1.28.0-next.1 → 1.28.0-next.13
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/README.md +56 -0
- package/lib/browser/monaco-color-registry.d.ts.map +1 -1
- package/lib/browser/monaco-color-registry.js +3 -2
- package/lib/browser/monaco-color-registry.js.map +1 -1
- package/lib/browser/monaco-diff-editor.d.ts.map +1 -1
- package/lib/browser/monaco-diff-editor.js +4 -0
- package/lib/browser/monaco-diff-editor.js.map +1 -1
- package/lib/browser/monaco-editor.d.ts.map +1 -1
- package/lib/browser/monaco-editor.js +4 -1
- package/lib/browser/monaco-editor.js.map +1 -1
- package/lib/browser/monaco-frontend-application-contribution.d.ts.map +1 -1
- package/lib/browser/monaco-frontend-application-contribution.js +5 -2
- package/lib/browser/monaco-frontend-application-contribution.js.map +1 -1
- package/lib/browser/monaco-indexed-db.d.ts +1 -1
- package/lib/browser/monaco-indexed-db.d.ts.map +1 -1
- package/lib/browser/monaco-quick-input-service.js.map +1 -1
- package/lib/browser/monaco-text-model-service.d.ts.map +1 -1
- package/lib/browser/monaco-text-model-service.js +15 -17
- package/lib/browser/monaco-text-model-service.js.map +1 -1
- package/lib/browser/textmate/monaco-textmate-frontend-bindings.d.ts +1 -1
- package/lib/browser/textmate/monaco-textmate-frontend-bindings.d.ts.map +1 -1
- package/lib/browser/textmate/monaco-textmate-frontend-bindings.js +38 -6
- package/lib/browser/textmate/monaco-textmate-frontend-bindings.js.map +1 -1
- package/lib/browser/textmate/monaco-textmate-service.d.ts +3 -3
- package/lib/browser/textmate/monaco-textmate-service.d.ts.map +1 -1
- package/lib/browser/textmate/monaco-textmate-service.js +8 -30
- package/lib/browser/textmate/monaco-textmate-service.js.map +1 -1
- package/lib/browser/textmate/monaco-theme-registry.d.ts +2 -7
- package/lib/browser/textmate/monaco-theme-registry.d.ts.map +1 -1
- package/lib/browser/textmate/monaco-theme-registry.js +9 -3
- package/lib/browser/textmate/monaco-theme-registry.js.map +1 -1
- package/lib/browser/textmate/monaco-theme-types.d.ts +11 -0
- package/lib/browser/textmate/monaco-theme-types.d.ts.map +1 -1
- package/lib/browser/textmate/monaco-theme-types.js +3 -0
- package/lib/browser/textmate/monaco-theme-types.js.map +1 -1
- package/package.json +10 -10
- package/src/browser/monaco-color-registry.ts +2 -1
- package/src/browser/monaco-diff-editor.ts +4 -0
- package/src/browser/monaco-editor.ts +4 -1
- package/src/browser/monaco-frontend-application-contribution.ts +5 -2
- package/src/browser/monaco-indexed-db.ts +1 -1
- package/src/browser/monaco-quick-input-service.ts +1 -1
- package/src/browser/monaco-text-model-service.ts +15 -16
- package/src/browser/textmate/monaco-textmate-frontend-bindings.ts +36 -6
- package/src/browser/textmate/monaco-textmate-service.ts +6 -29
- package/src/browser/textmate/monaco-theme-registry.ts +7 -10
- package/src/browser/textmate/monaco-theme-types.ts +12 -0
|
@@ -22,23 +22,55 @@ const textmate_registry_1 = require("./textmate-registry");
|
|
|
22
22
|
const textmate_contribution_1 = require("./textmate-contribution");
|
|
23
23
|
const monaco_textmate_service_1 = require("./monaco-textmate-service");
|
|
24
24
|
const monaco_theme_registry_1 = require("./monaco-theme-registry");
|
|
25
|
-
const
|
|
25
|
+
const vscode_oniguruma_1 = require("vscode-oniguruma");
|
|
26
|
+
const vscode_textmate_1 = require("vscode-textmate");
|
|
27
|
+
const monaco_theme_types_1 = require("./monaco-theme-types");
|
|
26
28
|
class OnigasmLib {
|
|
27
29
|
createOnigScanner(sources) {
|
|
28
|
-
return
|
|
30
|
+
return (0, vscode_oniguruma_1.createOnigScanner)(sources);
|
|
29
31
|
}
|
|
30
32
|
createOnigString(sources) {
|
|
31
|
-
return
|
|
33
|
+
return (0, vscode_oniguruma_1.createOnigString)(sources);
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
exports.OnigasmLib = OnigasmLib;
|
|
35
37
|
exports.default = (bind, unbind, isBound, rebind) => {
|
|
36
|
-
bind(
|
|
38
|
+
bind(monaco_theme_types_1.OnigasmPromise).toDynamicValue(dynamicOnigasmLib).inSingletonScope();
|
|
37
39
|
bind(monaco_textmate_service_1.MonacoTextmateService).toSelf().inSingletonScope();
|
|
38
40
|
bind(browser_1.FrontendApplicationContribution).toService(monaco_textmate_service_1.MonacoTextmateService);
|
|
39
41
|
(0, core_1.bindContributionProvider)(bind, textmate_contribution_1.LanguageGrammarDefinitionContribution);
|
|
40
42
|
bind(textmate_registry_1.TextmateRegistry).toSelf().inSingletonScope();
|
|
41
43
|
bind(monaco_theme_registry_1.MonacoThemeRegistry).toSelf().inSingletonScope();
|
|
44
|
+
bind(monaco_theme_types_1.TextmateRegistryFactory).toFactory(({ container }) => (theme) => {
|
|
45
|
+
const onigLib = container.get(monaco_theme_types_1.OnigasmPromise);
|
|
46
|
+
const textmateRegistry = container.get(textmate_registry_1.TextmateRegistry);
|
|
47
|
+
return new vscode_textmate_1.Registry({
|
|
48
|
+
onigLib,
|
|
49
|
+
theme,
|
|
50
|
+
loadGrammar: async (scopeName) => {
|
|
51
|
+
const provider = textmateRegistry.getProvider(scopeName);
|
|
52
|
+
if (provider) {
|
|
53
|
+
const definition = await provider.getGrammarDefinition();
|
|
54
|
+
let rawGrammar;
|
|
55
|
+
if (typeof definition.content === 'string') {
|
|
56
|
+
rawGrammar = (0, vscode_textmate_1.parseRawGrammar)(definition.content, definition.format === 'json' ? 'grammar.json' : 'grammar.plist');
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
rawGrammar = definition.content;
|
|
60
|
+
}
|
|
61
|
+
return rawGrammar;
|
|
62
|
+
}
|
|
63
|
+
return undefined;
|
|
64
|
+
},
|
|
65
|
+
getInjections: (scopeName) => {
|
|
66
|
+
const provider = textmateRegistry.getProvider(scopeName);
|
|
67
|
+
if (provider && provider.getInjections) {
|
|
68
|
+
return provider.getInjections(scopeName);
|
|
69
|
+
}
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
42
74
|
};
|
|
43
75
|
async function dynamicOnigasmLib(ctx) {
|
|
44
76
|
return createOnigasmLib();
|
|
@@ -49,13 +81,13 @@ async function createOnigasmLib() {
|
|
|
49
81
|
throw new Error('wasm not supported');
|
|
50
82
|
}
|
|
51
83
|
const wasm = await fetchOnigasm();
|
|
52
|
-
await (0,
|
|
84
|
+
await (0, vscode_oniguruma_1.loadWASM)(wasm);
|
|
53
85
|
return new OnigasmLib();
|
|
54
86
|
}
|
|
55
87
|
exports.createOnigasmLib = createOnigasmLib;
|
|
56
88
|
async function fetchOnigasm() {
|
|
57
89
|
// Using Webpack's wasm loader should give us a URL to fetch the resource from:
|
|
58
|
-
const onigasmPath = require('
|
|
90
|
+
const onigasmPath = require('vscode-oniguruma/release/onig.wasm');
|
|
59
91
|
const response = await fetch(onigasmPath, { method: 'GET' });
|
|
60
92
|
return response.arrayBuffer();
|
|
61
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monaco-textmate-frontend-bindings.js","sourceRoot":"","sources":["../../../src/browser/textmate/monaco-textmate-frontend-bindings.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAGhF,qDAAgG;AAChG,sCAAuD;AACvD,2DAAuD;AACvD,mEAAgF;AAChF,
|
|
1
|
+
{"version":3,"file":"monaco-textmate-frontend-bindings.js","sourceRoot":"","sources":["../../../src/browser/textmate/monaco-textmate-frontend-bindings.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,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,CAAC,CAAC;IACrB,OAAO,IAAI,UAAU,EAAE,CAAC;AAC5B,CAAC;AAPD,4CAOC;AAEM,KAAK,UAAU,YAAY;IAC9B,+EAA+E;IAC/E,MAAM,WAAW,GAAW,OAAO,CAAC,oCAAoC,CAAC,CAAC;IAC1E,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7D,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC;AALD,oCAKC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Registry
|
|
1
|
+
import { Registry } from 'vscode-textmate';
|
|
2
2
|
import { ILogger, ContributionProvider, DisposableCollection, Disposable } from '@theia/core';
|
|
3
3
|
import { FrontendApplicationContribution } from '@theia/core/lib/browser';
|
|
4
4
|
import { ThemeService } from '@theia/core/lib/browser/theming';
|
|
@@ -7,8 +7,7 @@ import { TokenizerOption } from './textmate-tokenizer';
|
|
|
7
7
|
import { TextmateRegistry } from './textmate-registry';
|
|
8
8
|
import { MonacoThemeRegistry } from './monaco-theme-registry';
|
|
9
9
|
import { EditorPreferences } from '@theia/editor/lib/browser/editor-preferences';
|
|
10
|
-
|
|
11
|
-
export declare type OnigasmPromise = Promise<IOnigLib>;
|
|
10
|
+
import { OnigasmPromise, TextmateRegistryFactory } from './monaco-theme-types';
|
|
12
11
|
export declare class MonacoTextmateService implements FrontendApplicationContribution {
|
|
13
12
|
protected readonly tokenizerOption: TokenizerOption;
|
|
14
13
|
protected readonly _activatedLanguages: Set<string>;
|
|
@@ -20,6 +19,7 @@ export declare class MonacoTextmateService implements FrontendApplicationContrib
|
|
|
20
19
|
protected readonly themeService: ThemeService;
|
|
21
20
|
protected readonly monacoThemeRegistry: MonacoThemeRegistry;
|
|
22
21
|
protected readonly preferences: EditorPreferences;
|
|
22
|
+
protected readonly registryFactory: TextmateRegistryFactory;
|
|
23
23
|
initialize(): void;
|
|
24
24
|
protected readonly toDisposeOnUpdateTheme: DisposableCollection;
|
|
25
25
|
protected updateTheme(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monaco-textmate-service.d.ts","sourceRoot":"","sources":["../../../src/browser/textmate/monaco-textmate-service.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"monaco-textmate-service.d.ts","sourceRoot":"","sources":["../../../src/browser/textmate/monaco-textmate-service.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9F,OAAO,EAAE,+BAA+B,EAAwB,MAAM,yBAAyB,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,qCAAqC,EAAwB,MAAM,yBAAyB,CAAC;AACtG,OAAO,EAA2B,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAQjF,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/E,qBACa,qBAAsB,YAAW,+BAA+B;IAEzE,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAEjD;IAEF,SAAS,CAAC,QAAQ,CAAC,mBAAmB,cAAqB;IAE3D,SAAS,CAAC,eAAe,EAAE,QAAQ,CAAC;IAGpC,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,qCAAqC,CAAC,CAAC;IAGjG,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAGtD,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAGnC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAGlD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAG9C,SAAS,CAAC,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAG5D,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IAGlD,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,uBAAuB,CAAC;IAE5D,UAAU,IAAI,IAAI;IA+BlB,SAAS,CAAC,QAAQ,CAAC,sBAAsB,uBAA8B;IAEvE,SAAS,CAAC,WAAW,IAAI,IAAI;IAiB7B,SAAS,KAAK,kBAAkB,IAAI,MAAM,CAEzC;IAED,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU;cAU9B,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IA4CtG,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,UAAU;CAQxE"}
|
|
@@ -24,9 +24,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
24
24
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.MonacoTextmateService =
|
|
27
|
+
exports.MonacoTextmateService = void 0;
|
|
28
28
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
|
-
const vscode_textmate_1 = require("vscode-textmate");
|
|
30
29
|
const core_1 = require("@theia/core");
|
|
31
30
|
const browser_1 = require("@theia/core/lib/browser");
|
|
32
31
|
const theming_1 = require("@theia/core/lib/browser/theming");
|
|
@@ -41,7 +40,7 @@ const standaloneTheme_1 = require("@theia/monaco-editor-core/esm/vs/editor/stand
|
|
|
41
40
|
const standaloneServices_1 = require("@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices");
|
|
42
41
|
const language_1 = require("@theia/monaco-editor-core/esm/vs/editor/common/languages/language");
|
|
43
42
|
const standaloneLanguages_1 = require("@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneLanguages");
|
|
44
|
-
|
|
43
|
+
const monaco_theme_types_1 = require("./monaco-theme-types");
|
|
45
44
|
let MonacoTextmateService = class MonacoTextmateService {
|
|
46
45
|
constructor() {
|
|
47
46
|
this.tokenizerOption = {
|
|
@@ -63,32 +62,7 @@ let MonacoTextmateService = class MonacoTextmateService {
|
|
|
63
62
|
console.error(err);
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
|
-
this.grammarRegistry =
|
|
67
|
-
getOnigLib: () => this.onigasmPromise,
|
|
68
|
-
theme: this.monacoThemeRegistry.getThemeData(this.currentEditorTheme),
|
|
69
|
-
loadGrammar: async (scopeName) => {
|
|
70
|
-
const provider = this.textmateRegistry.getProvider(scopeName);
|
|
71
|
-
if (provider) {
|
|
72
|
-
const definition = await provider.getGrammarDefinition();
|
|
73
|
-
let rawGrammar;
|
|
74
|
-
if (typeof definition.content === 'string') {
|
|
75
|
-
rawGrammar = (0, vscode_textmate_1.parseRawGrammar)(definition.content, definition.format === 'json' ? 'grammar.json' : 'grammar.plist');
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
rawGrammar = definition.content;
|
|
79
|
-
}
|
|
80
|
-
return rawGrammar;
|
|
81
|
-
}
|
|
82
|
-
return undefined;
|
|
83
|
-
},
|
|
84
|
-
getInjections: (scopeName) => {
|
|
85
|
-
const provider = this.textmateRegistry.getProvider(scopeName);
|
|
86
|
-
if (provider && provider.getInjections) {
|
|
87
|
-
return provider.getInjections(scopeName);
|
|
88
|
-
}
|
|
89
|
-
return [];
|
|
90
|
-
}
|
|
91
|
-
});
|
|
65
|
+
this.grammarRegistry = this.registryFactory(this.monacoThemeRegistry.getThemeData(this.currentEditorTheme));
|
|
92
66
|
this.tokenizerOption.lineLimit = this.preferences['editor.maxTokenizationLineLength'];
|
|
93
67
|
this.preferences.onPreferenceChanged(e => {
|
|
94
68
|
if (e.preferenceName === 'editor.maxTokenizationLineLength') {
|
|
@@ -186,7 +160,7 @@ __decorate([
|
|
|
186
160
|
__metadata("design:type", Object)
|
|
187
161
|
], MonacoTextmateService.prototype, "logger", void 0);
|
|
188
162
|
__decorate([
|
|
189
|
-
(0, inversify_1.inject)(
|
|
163
|
+
(0, inversify_1.inject)(monaco_theme_types_1.OnigasmPromise),
|
|
190
164
|
__metadata("design:type", Object)
|
|
191
165
|
], MonacoTextmateService.prototype, "onigasmPromise", void 0);
|
|
192
166
|
__decorate([
|
|
@@ -201,6 +175,10 @@ __decorate([
|
|
|
201
175
|
(0, inversify_1.inject)(editor_preferences_1.EditorPreferences),
|
|
202
176
|
__metadata("design:type", Object)
|
|
203
177
|
], MonacoTextmateService.prototype, "preferences", void 0);
|
|
178
|
+
__decorate([
|
|
179
|
+
(0, inversify_1.inject)(monaco_theme_types_1.TextmateRegistryFactory),
|
|
180
|
+
__metadata("design:type", Function)
|
|
181
|
+
], MonacoTextmateService.prototype, "registryFactory", void 0);
|
|
204
182
|
MonacoTextmateService = __decorate([
|
|
205
183
|
(0, inversify_1.injectable)()
|
|
206
184
|
], MonacoTextmateService);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monaco-textmate-service.js","sourceRoot":"","sources":["../../../src/browser/textmate/monaco-textmate-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,kDAAkD;AAClD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;;;;;;;;;;AAEhF,4DAAyE;
|
|
1
|
+
{"version":3,"file":"monaco-textmate-service.js","sourceRoot":"","sources":["../../../src/browser/textmate/monaco-textmate-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,kDAAkD;AAClD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;;;;;;;;;;AAEhF,4DAAyE;AAEzE,sCAA8F;AAC9F,qDAAgG;AAChG,6DAA+D;AAC/D,mEAAsG;AACtG,6DAAgF;AAChF,2DAAuD;AACvD,mEAA8D;AAC9D,qFAAiF;AACjF,oDAAoD;AACpD,wFAAgG;AAChG,+GAAoH;AACpH,sHAAmH;AACnH,gGAAqG;AACrG,wHAA4H;AAE5H,6DAA+E;AAG/E,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IAAlC;QAEuB,oBAAe,GAAoB;YAClD,SAAS,EAAE,GAAG;SACjB,CAAC;QAEiB,wBAAmB,GAAG,IAAI,GAAG,EAAU,CAAC;QA2DxC,2BAAsB,GAAG,IAAI,2BAAoB,EAAE,CAAC;IAqF3E,CAAC;IApHG,UAAU;QACN,IAAI,CAAC,8BAAoB,EAAE;YACvB,OAAO,CAAC,GAAG,CAAC,mEAAmE,CAAC,CAAC;YACjF,OAAO;SACV;QAED,KAAK,MAAM,eAAe,IAAI,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,EAAE;YACpE,IAAI;gBACA,eAAe,CAAC,wBAAwB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;aACnE;YAAC,OAAO,GAAG,EAAE;gBACV,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACtB;SACJ;QAED,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,IA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;IACL,CAAC;IAES,eAAe,CAAC,QAAgB,EAAE,EAAY;QACpD,MAAM,eAAe,GAAG,uCAAkB,CAAC,GAAG,CAAC,2BAAgB,CAAoB,CAAC;QACpF,IAAI,eAAe,CAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YACxD,EAAE,EAAE,CAAC;YACL,OAAO,iBAAU,CAAC,IAAI,CAAC;SAC1B;QACD,OAAO,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACrD,CAAC;CACJ,CAAA;AA3IG;IADC,IAAA,kBAAM,EAAC,2BAAoB,CAAC;IAAE,IAAA,iBAAK,EAAC,6DAAqC,CAAC;;+DACsB;AAGjG;IADC,IAAA,kBAAM,EAAC,oCAAgB,CAAC;8BACY,oCAAgB;+DAAC;AAGtD;IADC,IAAA,kBAAM,EAAC,cAAO,CAAC;;qDACmB;AAGnC;IADC,IAAA,kBAAM,EAAC,mCAAc,CAAC;;6DAC2B;AAGlD;IADC,IAAA,kBAAM,EAAC,sBAAY,CAAC;8BACY,sBAAY;2DAAC;AAG9C;IADC,IAAA,kBAAM,EAAC,2CAAmB,CAAC;8BACY,2CAAmB;kEAAC;AAG5D;IADC,IAAA,kBAAM,EAAC,sCAAiB,CAAC;;0DACwB;AAGlD;IADC,IAAA,kBAAM,EAAC,4CAAuB,CAAC;;8DAC4B;AAhCnD,qBAAqB;IADjC,IAAA,sBAAU,GAAE;GACA,qBAAqB,CAsJjC;AAtJY,sDAAqB"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import { IRawTheme } from 'vscode-textmate';
|
|
2
1
|
import * as monaco from '@theia/monaco-editor-core';
|
|
3
|
-
import { IStandaloneTheme } from '@theia/monaco-editor-core/esm/vs/editor/standalone/common/standaloneTheme';
|
|
4
2
|
import { Color } from '@theia/monaco-editor-core/esm/vs/base/common/color';
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export interface MixStandaloneTheme extends IStandaloneTheme {
|
|
8
|
-
themeData: ThemeMix;
|
|
9
|
-
}
|
|
3
|
+
import { MixStandaloneTheme, TextmateRegistryFactory, ThemeMix } from './monaco-theme-types';
|
|
10
4
|
export declare class MonacoThemeRegistry {
|
|
5
|
+
protected readonly registryFactory: TextmateRegistryFactory;
|
|
11
6
|
initializeDefaultThemes(): void;
|
|
12
7
|
getThemeData(): ThemeMix;
|
|
13
8
|
getThemeData(name: string): ThemeMix | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monaco-theme-registry.d.ts","sourceRoot":"","sources":["../../../src/browser/textmate/monaco-theme-registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"monaco-theme-registry.d.ts","sourceRoot":"","sources":["../../../src/browser/textmate/monaco-theme-registry.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAIpD,OAAO,EAAE,KAAK,EAAE,MAAM,oDAAoD,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE7F,qBACa,mBAAmB;IAEK,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,uBAAuB,CAAC;IAE7F,uBAAuB,IAAI,IAAI;IAc/B,YAAY,IAAI,QAAQ;IACxB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAMhD,QAAQ,IAAI,kBAAkB;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAKtD,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,kBAAkB,GAAG,SAAS;IAM9E,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI;IAK5C;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE;QAAE,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,GAAG,QAAQ;IAiErI,SAAS,CAAC,SAAS,CAAC,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe,KAAK,IAAI,GAAG,IAAI;IAcnG,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS;CAYlF;AAED,yBAAiB,mBAAmB,CAAC;IAC1B,MAAM,kBAAkB,eAAe,CAAC;IACxC,MAAM,mBAAmB,gBAAgB,CAAC;IAC1C,MAAM,gBAAgB,aAAa,CAAC;CAC9C"}
|
|
@@ -20,14 +20,17 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
20
20
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
21
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
22
|
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
23
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
27
|
exports.MonacoThemeRegistry = void 0;
|
|
25
28
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
26
29
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
27
|
-
const vscode_textmate_1 = require("vscode-textmate");
|
|
28
30
|
const monaco = require("@theia/monaco-editor-core");
|
|
29
31
|
const standaloneTheme_1 = require("@theia/monaco-editor-core/esm/vs/editor/standalone/common/standaloneTheme");
|
|
30
32
|
const standaloneServices_1 = require("@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices");
|
|
33
|
+
const monaco_theme_types_1 = require("./monaco-theme-types");
|
|
31
34
|
let MonacoThemeRegistry = class MonacoThemeRegistry {
|
|
32
35
|
initializeDefaultThemes() {
|
|
33
36
|
this.register(require('../../../data/monaco-themes/vscode/dark_theia.json'), {
|
|
@@ -115,8 +118,7 @@ let MonacoThemeRegistry = class MonacoThemeRegistry {
|
|
|
115
118
|
background: this.normalizeColor(background)
|
|
116
119
|
}
|
|
117
120
|
});
|
|
118
|
-
const reg =
|
|
119
|
-
reg.setTheme(result);
|
|
121
|
+
const reg = this.registryFactory(result);
|
|
120
122
|
result.encodedTokensColors = reg.getColorMap();
|
|
121
123
|
// index 0 has to be set to null as it is 'undefined' by default, but monaco code expects it to be null
|
|
122
124
|
// eslint-disable-next-line no-null/no-null
|
|
@@ -149,6 +151,10 @@ let MonacoThemeRegistry = class MonacoThemeRegistry {
|
|
|
149
151
|
return '#' + normalized;
|
|
150
152
|
}
|
|
151
153
|
};
|
|
154
|
+
__decorate([
|
|
155
|
+
(0, inversify_1.inject)(monaco_theme_types_1.TextmateRegistryFactory),
|
|
156
|
+
__metadata("design:type", Function)
|
|
157
|
+
], MonacoThemeRegistry.prototype, "registryFactory", void 0);
|
|
152
158
|
MonacoThemeRegistry = __decorate([
|
|
153
159
|
(0, inversify_1.injectable)()
|
|
154
160
|
], MonacoThemeRegistry);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monaco-theme-registry.js","sourceRoot":"","sources":["../../../src/browser/textmate/monaco-theme-registry.ts"],"names":[],"mappings":";AACA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF
|
|
1
|
+
{"version":3,"file":"mona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,CAAC,IAAI,EAAE,CAAC,CAAC;SACvF;QAED,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,KAAK,EAAE;YAClC,QAAQ,iCACD,UAAU,CAAC,QAAQ,KAAE,KAAK,EAAE,KAAK,IACtC,CAAC;SACN;IACL,CAAC;IAES,cAAc,CAAC,KAAiC;QACtD,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,SAAS,CAAC;SACpB;QACD,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAChE,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE;YAClE,0GAA0G;YAC1G,OAAO,CAAC,KAAK,CAAC,UAAU,UAAU,gDAAgD,CAAC,CAAC;YACpF,OAAO,SAAS,CAAC;SACpB;QACD,OAAO,GAAG,GAAG,UAAU,CAAC;IAC5B,CAAC;CACJ,CAAA;AAtIoC;IAAhC,IAAA,kBAAM,EAAC,4CAAuB,CAAC;;4DAA6D;AAFpF,mBAAmB;IAD/B,IAAA,sBAAU,GAAE;GACA,mBAAmB,CAwI/B;AAxIY,kDAAmB;AA0IhC,WAAiB,mBAAmB;IACnB,sCAAkB,GAAG,YAAY,CAAC;IAClC,uCAAmB,GAAG,aAAa,CAAC;IACpC,oCAAgB,GAAG,UAAU,CAAC;AAC/C,CAAC,EAJgB,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAInC;AA9IY,kDAAmB"}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import * as monaco from '@theia/monaco-editor-core';
|
|
2
|
+
import { IStandaloneTheme } from '@theia/monaco-editor-core/esm/vs/editor/standalone/common/standaloneTheme';
|
|
3
|
+
import { IOnigLib, IRawTheme, Registry } from 'vscode-textmate';
|
|
4
|
+
export interface ThemeMix extends IRawTheme, monaco.editor.IStandaloneThemeData {
|
|
5
|
+
}
|
|
6
|
+
export interface MixStandaloneTheme extends IStandaloneTheme {
|
|
7
|
+
themeData: ThemeMix;
|
|
8
|
+
}
|
|
9
|
+
export declare const OnigasmPromise: unique symbol;
|
|
10
|
+
export declare type OnigasmPromise = Promise<IOnigLib>;
|
|
11
|
+
export declare const TextmateRegistryFactory: unique symbol;
|
|
12
|
+
export declare type TextmateRegistryFactory = (currentTheme?: ThemeMix) => Registry;
|
|
2
13
|
export declare type MonacoThemeColor = monaco.editor.IColors;
|
|
3
14
|
export interface MonacoTokenRule extends monaco.editor.ITokenThemeRule {
|
|
4
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monaco-theme-types.d.ts","sourceRoot":"","sources":["../../../src/browser/textmate/monaco-theme-types.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"monaco-theme-types.d.ts","sourceRoot":"","sources":["../../../src/browser/textmate/monaco-theme-types.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2EAA2E,CAAC;AAC7G,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhE,MAAM,WAAW,QAAS,SAAQ,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,oBAAoB;CAAI;AACnF,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IACxD,SAAS,EAAE,QAAQ,CAAA;CACtB;AAED,eAAO,MAAM,cAAc,eAA2B,CAAC;AACvD,oBAAY,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC/C,eAAO,MAAM,uBAAuB,eAAoC,CAAC;AACzE,oBAAY,uBAAuB,GAAG,CAAC,YAAY,CAAC,EAAE,QAAQ,KAAK,QAAQ,CAAC;AAE5E,oBAAY,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;AACrD,MAAM,WAAW,eAAgB,SAAQ,MAAM,CAAC,MAAM,CAAC,eAAe;CAAI;AAC1E,oBAAY,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;AAC5D,MAAM,WAAW,WAAY,SAAQ,MAAM,CAAC,MAAM,CAAC,oBAAoB;IACnE,IAAI,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -15,5 +15,8 @@
|
|
|
15
15
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
16
|
// *****************************************************************************
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.TextmateRegistryFactory = exports.OnigasmPromise = void 0;
|
|
19
|
+
exports.OnigasmPromise = Symbol('OnigasmPromise');
|
|
20
|
+
exports.TextmateRegistryFactory = Symbol('TextmateRegistryFactory');
|
|
18
21
|
;
|
|
19
22
|
//# sourceMappingURL=monaco-theme-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monaco-theme-types.js","sourceRoot":"","sources":["../../../src/browser/textmate/monaco-theme-types.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF
|
|
1
|
+
{"version":3,"file":"monaco-theme-types.js","sourceRoot":"","sources":["../../../src/browser/textmate/monaco-theme-types.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAWnE,QAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAE1C,QAAA,uBAAuB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAIC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/monaco",
|
|
3
|
-
"version": "1.28.0-next.
|
|
3
|
+
"version": "1.28.0-next.13+2784ecd9b11",
|
|
4
4
|
"description": "Theia - Monaco Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.28.0-next.
|
|
7
|
-
"@theia/editor": "1.28.0-next.
|
|
8
|
-
"@theia/filesystem": "1.28.0-next.
|
|
9
|
-
"@theia/markers": "1.28.0-next.
|
|
10
|
-
"@theia/monaco-editor-core": "1.
|
|
11
|
-
"@theia/outline-view": "1.28.0-next.
|
|
6
|
+
"@theia/core": "1.28.0-next.13+2784ecd9b11",
|
|
7
|
+
"@theia/editor": "1.28.0-next.13+2784ecd9b11",
|
|
8
|
+
"@theia/filesystem": "1.28.0-next.13+2784ecd9b11",
|
|
9
|
+
"@theia/markers": "1.28.0-next.13+2784ecd9b11",
|
|
10
|
+
"@theia/monaco-editor-core": "1.67.2",
|
|
11
|
+
"@theia/outline-view": "1.28.0-next.13+2784ecd9b11",
|
|
12
12
|
"fast-plist": "^0.1.2",
|
|
13
13
|
"idb": "^4.0.5",
|
|
14
14
|
"jsonc-parser": "^2.2.0",
|
|
15
|
-
"
|
|
16
|
-
"vscode-textmate": "^
|
|
15
|
+
"vscode-oniguruma": "1.6.1",
|
|
16
|
+
"vscode-textmate": "^7.0.1"
|
|
17
17
|
},
|
|
18
18
|
"publishConfig": {
|
|
19
19
|
"access": "public"
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"nyc": {
|
|
55
55
|
"extends": "../../configs/nyc.json"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "2784ecd9b114fd6839656b24eeee6111f64ac2e8"
|
|
58
58
|
}
|
|
@@ -45,7 +45,8 @@ export class MonacoColorRegistry extends ColorRegistry {
|
|
|
45
45
|
const defaults: ColorDefaults = {
|
|
46
46
|
dark: this.toColor(definition.defaults?.dark),
|
|
47
47
|
light: this.toColor(definition.defaults?.light),
|
|
48
|
-
|
|
48
|
+
hcDark: this.toColor(definition.defaults?.hcDark ?? definition.defaults?.hc),
|
|
49
|
+
hcLight: this.toColor(definition.defaults?.hcLight),
|
|
49
50
|
};
|
|
50
51
|
const identifier = this.monacoColorRegistry.registerColor(definition.id, defaults, definition.description);
|
|
51
52
|
return Disposable.create(() => this.monacoColorRegistry.deregisterColor(identifier));
|
|
@@ -63,6 +63,10 @@ export class MonacoDiffEditor extends MonacoEditor {
|
|
|
63
63
|
|
|
64
64
|
protected override create(options?: IDiffEditorConstructionOptions, override?: EditorServiceOverrides): Disposable {
|
|
65
65
|
const instantiator = this.getInstantiatorWithOverrides(override);
|
|
66
|
+
/**
|
|
67
|
+
* @monaco-uplift. Should be guaranteed to work.
|
|
68
|
+
* Incomparable enums prevent TypeScript from believing that public IStandaloneDiffEditor is satisfied by private StandaloneDiffEditor
|
|
69
|
+
*/
|
|
66
70
|
this._diffEditor = instantiator
|
|
67
71
|
.createInstance(StandaloneDiffEditor, this.node, { ...options, fixedOverflowWidgets: true }) as unknown as monaco.editor.IStandaloneDiffEditor;
|
|
68
72
|
this.editor = this._diffEditor.getModifiedEditor();
|
|
@@ -142,7 +142,10 @@ export class MonacoEditor extends MonacoEditorServices implements TextEditor {
|
|
|
142
142
|
}
|
|
143
143
|
} as IStandaloneEditorConstructionOptions;
|
|
144
144
|
const instantiator = this.getInstantiatorWithOverrides(override);
|
|
145
|
-
|
|
145
|
+
/**
|
|
146
|
+
* @monaco-uplift. Should be guaranteed to work.
|
|
147
|
+
* Incomparable enums prevent TypeScript from believing that public IStandaloneCodeEditor is satisfied by private StandaloneCodeEditor
|
|
148
|
+
*/
|
|
146
149
|
return this.editor = instantiator.createInstance(StandaloneEditor, this.node, combinedOptions) as unknown as monaco.editor.IStandaloneCodeEditor;
|
|
147
150
|
}
|
|
148
151
|
|
|
@@ -74,7 +74,10 @@ export class MonacoFrontendApplicationContribution implements FrontendApplicatio
|
|
|
74
74
|
// Monaco registers certain quick access providers (e.g. QuickCommandAccess) at import time, but we want to use our own.
|
|
75
75
|
this.quickAccessRegistry.clear();
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
/**
|
|
78
|
+
* @monaco-uplift.Should be guaranteed to work.
|
|
79
|
+
* Incomparable enums prevent TypeScript from believing that public ITextModel satisfied private ITextModel
|
|
80
|
+
*/
|
|
78
81
|
setSnippetSuggestSupport(this.snippetSuggestProvider as unknown as CompletionItemProvider);
|
|
79
82
|
|
|
80
83
|
for (const language of monaco.languages.getLanguages()) {
|
|
@@ -167,7 +170,7 @@ export class MonacoFrontendApplicationContribution implements FrontendApplicatio
|
|
|
167
170
|
new editorBoolConstructor(id++, 'wordBasedSuggestions', true, editorGeneratedPreferenceProperties['editor.wordBasedSuggestions']),
|
|
168
171
|
new editorStringEnumConstructor(id++, 'wordBasedSuggestionsMode', 'matchingDocuments', editorGeneratedPreferenceProperties['editor.wordBasedSuggestionsMode'].enum, editorGeneratedPreferenceProperties['editor.wordBasedSuggestionsMode']),
|
|
169
172
|
new editorBoolConstructor(id++, 'stablePeek', false, editorGeneratedPreferenceProperties['editor.stablePeek']),
|
|
170
|
-
new editorIntConstructor(id++, '
|
|
173
|
+
new editorIntConstructor(id++, 'maxTokenizationLineLength', 20000, 1, MAX_SAFE_INTEGER, editorGeneratedPreferenceProperties['editor.maxTokenizationLineLength']),
|
|
171
174
|
);
|
|
172
175
|
}
|
|
173
176
|
}
|
|
@@ -19,7 +19,7 @@ import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposa
|
|
|
19
19
|
import { ThemeService } from '@theia/core/lib/browser/theming';
|
|
20
20
|
import * as monaco from '@theia/monaco-editor-core';
|
|
21
21
|
import { injectable } from '@theia/core/shared/inversify';
|
|
22
|
-
import type { ThemeMix } from './textmate/monaco-theme-
|
|
22
|
+
import type { ThemeMix } from './textmate/monaco-theme-types';
|
|
23
23
|
import { Theme } from '@theia/core/lib/common/theme';
|
|
24
24
|
|
|
25
25
|
let _monacoDB: Promise<idb.IDBPDatabase> | undefined;
|
|
@@ -214,7 +214,7 @@ export class MonacoQuickInputService implements QuickInputService {
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
createInputBox(): InputBox {
|
|
217
|
-
return this.monacoService.createInputBox()
|
|
217
|
+
return this.monacoService.createInputBox();
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
input(options?: InputOptions, token?: monaco.CancellationToken): Promise<string | undefined> {
|
|
@@ -134,7 +134,9 @@ export class MonacoTextModelService implements ITextModelService {
|
|
|
134
134
|
switch (editorPreference) {
|
|
135
135
|
case 'editor.tabSize': return 'tabSize';
|
|
136
136
|
case 'editor.insertSpaces': return 'insertSpaces';
|
|
137
|
-
case 'editor.bracketPairColorization.enabled':
|
|
137
|
+
case 'editor.bracketPairColorization.enabled':
|
|
138
|
+
case 'editor.bracketPairColorization.independentColorPoolPerBracketType':
|
|
139
|
+
return 'bracketColorizationOptions';
|
|
138
140
|
case 'editor.trimAutoWhitespace': return 'trimAutoWhitespace';
|
|
139
141
|
|
|
140
142
|
}
|
|
@@ -142,28 +144,21 @@ export class MonacoTextModelService implements ITextModelService {
|
|
|
142
144
|
}
|
|
143
145
|
|
|
144
146
|
protected updateModel(model: MonacoEditorModel, change?: EditorPreferenceChange): void {
|
|
145
|
-
if (change) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
if (!change) {
|
|
148
|
+
model.autoSave = this.editorPreferences.get('files.autoSave', undefined, model.uri);
|
|
149
|
+
model.autoSaveDelay = this.editorPreferences.get('files.autoSaveDelay', undefined, model.uri);
|
|
150
|
+
model.textEditorModel.updateOptions(this.getModelOptions(model));
|
|
151
|
+
} else if (change.affects(model.uri, model.languageId)) {
|
|
149
152
|
if (change.preferenceName === 'files.autoSave') {
|
|
150
153
|
model.autoSave = this.editorPreferences.get('files.autoSave', undefined, model.uri);
|
|
151
154
|
}
|
|
152
155
|
if (change.preferenceName === 'files.autoSaveDelay') {
|
|
153
156
|
model.autoSaveDelay = this.editorPreferences.get('files.autoSaveDelay', undefined, model.uri);
|
|
154
157
|
}
|
|
155
|
-
const modelOption = this.
|
|
158
|
+
const modelOption = this.toModelOption(change.preferenceName);
|
|
156
159
|
if (modelOption) {
|
|
157
|
-
|
|
158
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
159
|
-
const newValue = change.newValue as any;
|
|
160
|
-
options[modelOption] = change.preferenceName === 'editor.bracketPairColorization.enabled' ? { enabled: newValue } : newValue;
|
|
161
|
-
model.textEditorModel.updateOptions(options);
|
|
160
|
+
model.textEditorModel.updateOptions(this.getModelOptions(model));
|
|
162
161
|
}
|
|
163
|
-
} else {
|
|
164
|
-
model.autoSave = this.editorPreferences.get('files.autoSave', undefined, model.uri);
|
|
165
|
-
model.autoSaveDelay = this.editorPreferences.get('files.autoSaveDelay', undefined, model.uri);
|
|
166
|
-
model.textEditorModel.updateOptions(this.getModelOptions(model));
|
|
167
162
|
}
|
|
168
163
|
}
|
|
169
164
|
|
|
@@ -176,7 +171,11 @@ export class MonacoTextModelService implements ITextModelService {
|
|
|
176
171
|
return {
|
|
177
172
|
tabSize: this.editorPreferences.get({ preferenceName: 'editor.tabSize', overrideIdentifier }, undefined, uri),
|
|
178
173
|
insertSpaces: this.editorPreferences.get({ preferenceName: 'editor.insertSpaces', overrideIdentifier }, undefined, uri),
|
|
179
|
-
bracketColorizationOptions: {
|
|
174
|
+
bracketColorizationOptions: {
|
|
175
|
+
enabled: this.editorPreferences.get({ preferenceName: 'editor.bracketPairColorization.enabled', overrideIdentifier }, undefined, uri),
|
|
176
|
+
independentColorPoolPerBracketType: this.editorPreferences.get(
|
|
177
|
+
{ preferenceName: 'editor.bracketPairColorization.independentColorPoolPerBracketType', overrideIdentifier }, undefined, uri),
|
|
178
|
+
},
|
|
180
179
|
trimAutoWhitespace: this.editorPreferences.get({ preferenceName: 'editor.trimAutoWhitespace', overrideIdentifier }, undefined, uri),
|
|
181
180
|
};
|
|
182
181
|
}
|
|
@@ -19,17 +19,18 @@ import { FrontendApplicationContribution, isBasicWasmSupported } from '@theia/co
|
|
|
19
19
|
import { bindContributionProvider } from '@theia/core';
|
|
20
20
|
import { TextmateRegistry } from './textmate-registry';
|
|
21
21
|
import { LanguageGrammarDefinitionContribution } from './textmate-contribution';
|
|
22
|
-
import { MonacoTextmateService
|
|
22
|
+
import { MonacoTextmateService } from './monaco-textmate-service';
|
|
23
23
|
import { MonacoThemeRegistry } from './monaco-theme-registry';
|
|
24
|
-
import { loadWASM, OnigScanner, OnigString } from '
|
|
25
|
-
import { IOnigLib } from 'vscode-textmate';
|
|
24
|
+
import { loadWASM, createOnigScanner, OnigScanner, createOnigString, OnigString } from 'vscode-oniguruma';
|
|
25
|
+
import { IOnigLib, IRawGrammar, parseRawGrammar, Registry } from 'vscode-textmate';
|
|
26
|
+
import { OnigasmPromise, TextmateRegistryFactory, ThemeMix } from './monaco-theme-types';
|
|
26
27
|
|
|
27
28
|
export class OnigasmLib implements IOnigLib {
|
|
28
29
|
createOnigScanner(sources: string[]): OnigScanner {
|
|
29
|
-
return
|
|
30
|
+
return createOnigScanner(sources);
|
|
30
31
|
}
|
|
31
32
|
createOnigString(sources: string): OnigString {
|
|
32
|
-
return
|
|
33
|
+
return createOnigString(sources);
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
|
|
@@ -40,6 +41,35 @@ export default (bind: interfaces.Bind, unbind: interfaces.Unbind, isBound: inter
|
|
|
40
41
|
bindContributionProvider(bind, LanguageGrammarDefinitionContribution);
|
|
41
42
|
bind(TextmateRegistry).toSelf().inSingletonScope();
|
|
42
43
|
bind(MonacoThemeRegistry).toSelf().inSingletonScope();
|
|
44
|
+
bind(TextmateRegistryFactory).toFactory(({ container }) => (theme?: ThemeMix) => {
|
|
45
|
+
const onigLib = container.get<OnigasmPromise>(OnigasmPromise);
|
|
46
|
+
const textmateRegistry = container.get(TextmateRegistry);
|
|
47
|
+
return new Registry({
|
|
48
|
+
onigLib,
|
|
49
|
+
theme,
|
|
50
|
+
loadGrammar: async (scopeName: string) => {
|
|
51
|
+
const provider = textmateRegistry.getProvider(scopeName);
|
|
52
|
+
if (provider) {
|
|
53
|
+
const definition = await provider.getGrammarDefinition();
|
|
54
|
+
let rawGrammar: IRawGrammar;
|
|
55
|
+
if (typeof definition.content === 'string') {
|
|
56
|
+
rawGrammar = parseRawGrammar(definition.content, definition.format === 'json' ? 'grammar.json' : 'grammar.plist');
|
|
57
|
+
} else {
|
|
58
|
+
rawGrammar = definition.content as IRawGrammar;
|
|
59
|
+
}
|
|
60
|
+
return rawGrammar;
|
|
61
|
+
}
|
|
62
|
+
return undefined;
|
|
63
|
+
},
|
|
64
|
+
getInjections: (scopeName: string) => {
|
|
65
|
+
const provider = textmateRegistry.getProvider(scopeName);
|
|
66
|
+
if (provider && provider.getInjections) {
|
|
67
|
+
return provider.getInjections(scopeName);
|
|
68
|
+
}
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
43
73
|
};
|
|
44
74
|
|
|
45
75
|
export async function dynamicOnigasmLib(ctx: interfaces.Context): Promise<IOnigLib> {
|
|
@@ -57,7 +87,7 @@ export async function createOnigasmLib(): Promise<IOnigLib> {
|
|
|
57
87
|
|
|
58
88
|
export async function fetchOnigasm(): Promise<ArrayBuffer> {
|
|
59
89
|
// Using Webpack's wasm loader should give us a URL to fetch the resource from:
|
|
60
|
-
const onigasmPath: string = require('
|
|
90
|
+
const onigasmPath: string = require('vscode-oniguruma/release/onig.wasm');
|
|
61
91
|
const response = await fetch(onigasmPath, { method: 'GET' });
|
|
62
92
|
return response.arrayBuffer();
|
|
63
93
|
}
|