@theia/monaco 1.27.0-next.5 → 1.27.0-next.53
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/lib/browser/monaco-color-registry.d.ts +2 -1
- package/lib/browser/monaco-color-registry.d.ts.map +1 -1
- package/lib/browser/monaco-color-registry.js.map +1 -1
- package/lib/browser/monaco-frontend-application-contribution.d.ts +7 -3
- package/lib/browser/monaco-frontend-application-contribution.d.ts.map +1 -1
- package/lib/browser/monaco-frontend-application-contribution.js +58 -1
- package/lib/browser/monaco-frontend-application-contribution.js.map +1 -1
- package/lib/browser/monaco-frontend-module.d.ts.map +1 -1
- package/lib/browser/monaco-frontend-module.js +7 -2
- package/lib/browser/monaco-frontend-module.js.map +1 -1
- package/lib/browser/monaco-indexed-db.d.ts +3 -4
- package/lib/browser/monaco-indexed-db.d.ts.map +1 -1
- package/lib/browser/monaco-indexed-db.js +18 -21
- package/lib/browser/monaco-indexed-db.js.map +1 -1
- package/lib/browser/monaco-quick-input-service.d.ts.map +1 -1
- package/lib/browser/monaco-quick-input-service.js +23 -2
- package/lib/browser/monaco-quick-input-service.js.map +1 -1
- package/lib/browser/monaco-theming-service.d.ts +12 -6
- package/lib/browser/monaco-theming-service.d.ts.map +1 -1
- package/lib/browser/monaco-theming-service.js +27 -14
- package/lib/browser/monaco-theming-service.js.map +1 -1
- package/lib/browser/textmate/monaco-textmate-frontend-bindings.js +1 -1
- package/lib/browser/textmate/monaco-textmate-frontend-bindings.js.map +1 -1
- package/lib/browser/textmate/monaco-theme-registry.d.ts +4 -4
- package/lib/browser/textmate/monaco-theme-registry.d.ts.map +1 -1
- package/lib/browser/textmate/monaco-theme-registry.js +16 -12
- package/lib/browser/textmate/monaco-theme-registry.js.map +1 -1
- package/package.json +7 -7
- package/src/browser/monaco-color-registry.ts +2 -1
- package/src/browser/monaco-frontend-application-contribution.ts +56 -4
- package/src/browser/monaco-frontend-module.ts +9 -4
- package/src/browser/monaco-indexed-db.ts +11 -23
- package/src/browser/monaco-quick-input-service.ts +24 -2
- package/src/browser/monaco-theming-service.ts +20 -16
- package/src/browser/style/index.css +7 -1
- package/src/browser/textmate/monaco-textmate-frontend-bindings.ts +1 -1
- package/src/browser/textmate/monaco-theme-registry.ts +17 -13
|
@@ -37,6 +37,10 @@ const monaco_theme_registry_1 = require("./textmate/monaco-theme-registry");
|
|
|
37
37
|
const monaco_indexed_db_1 = require("./monaco-indexed-db");
|
|
38
38
|
const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
|
|
39
39
|
let MonacoThemingService = MonacoThemingService_1 = class MonacoThemingService {
|
|
40
|
+
constructor() {
|
|
41
|
+
this.toUpdateUiTheme = new disposable_1.DisposableCollection();
|
|
42
|
+
}
|
|
43
|
+
/** Register themes whose configuration needs to be loaded */
|
|
40
44
|
register(theme, pending = {}) {
|
|
41
45
|
const toDispose = new disposable_1.DisposableCollection(disposable_1.Disposable.create(() => { }));
|
|
42
46
|
this.doRegister(theme, pending, toDispose);
|
|
@@ -51,7 +55,7 @@ let MonacoThemingService = MonacoThemingService_1 = class MonacoThemingService {
|
|
|
51
55
|
}
|
|
52
56
|
const label = theme.label || new uri_1.default(theme.uri).path.base;
|
|
53
57
|
const { id, description, uiTheme } = theme;
|
|
54
|
-
toDispose.push(
|
|
58
|
+
toDispose.push(this.registerParsedTheme({ id, label, description, uiTheme: uiTheme, json, includes }));
|
|
55
59
|
}
|
|
56
60
|
catch (e) {
|
|
57
61
|
console.error('Failed to load theme from ' + theme.uri, e);
|
|
@@ -95,35 +99,37 @@ let MonacoThemingService = MonacoThemingService_1 = class MonacoThemingService {
|
|
|
95
99
|
}
|
|
96
100
|
return pending[referencedUri];
|
|
97
101
|
}
|
|
98
|
-
|
|
102
|
+
initialize() {
|
|
103
|
+
this.monacoThemeRegistry.initializeDefaultThemes();
|
|
99
104
|
this.updateBodyUiTheme();
|
|
100
|
-
|
|
105
|
+
this.themeService.onDidColorThemeChange(() => this.updateBodyUiTheme());
|
|
101
106
|
this.restore();
|
|
102
107
|
}
|
|
103
|
-
|
|
108
|
+
/** register a theme whose configuration has already been loaded */
|
|
109
|
+
registerParsedTheme(theme) {
|
|
104
110
|
const uiTheme = theme.uiTheme || 'vs-dark';
|
|
105
111
|
const { label, description, json, includes } = theme;
|
|
106
112
|
const id = theme.id || label;
|
|
107
113
|
const cssSelector = MonacoThemingService_1.toCssSelector(id);
|
|
108
|
-
const data =
|
|
109
|
-
return
|
|
114
|
+
const data = this.monacoThemeRegistry.register(json, includes, cssSelector, uiTheme);
|
|
115
|
+
return this.doRegisterParsedTheme({ id, label, description, uiTheme, data });
|
|
110
116
|
}
|
|
111
|
-
|
|
117
|
+
updateBodyUiTheme() {
|
|
112
118
|
this.toUpdateUiTheme.dispose();
|
|
113
|
-
const type =
|
|
119
|
+
const type = this.themeService.getCurrentTheme().type;
|
|
114
120
|
const uiTheme = type === 'hc' ? 'hc-black' : type === 'light' ? 'vs' : 'vs-dark';
|
|
115
121
|
document.body.classList.add(uiTheme);
|
|
116
122
|
this.toUpdateUiTheme.push(disposable_1.Disposable.create(() => document.body.classList.remove(uiTheme)));
|
|
117
123
|
}
|
|
118
|
-
|
|
119
|
-
return new disposable_1.DisposableCollection(
|
|
124
|
+
doRegisterParsedTheme(state) {
|
|
125
|
+
return new disposable_1.DisposableCollection(this.themeService.register((0, monaco_indexed_db_1.stateToTheme)(state)), (0, monaco_indexed_db_1.putTheme)(state));
|
|
120
126
|
}
|
|
121
|
-
|
|
127
|
+
async restore() {
|
|
122
128
|
try {
|
|
123
129
|
const themes = await (0, monaco_indexed_db_1.getThemes)();
|
|
124
130
|
for (const state of themes) {
|
|
125
|
-
|
|
126
|
-
|
|
131
|
+
this.monacoThemeRegistry.setTheme(state.data.name, state.data);
|
|
132
|
+
this.doRegisterParsedTheme(state);
|
|
127
133
|
}
|
|
128
134
|
}
|
|
129
135
|
catch (e) {
|
|
@@ -147,11 +153,18 @@ let MonacoThemingService = MonacoThemingService_1 = class MonacoThemingService {
|
|
|
147
153
|
}
|
|
148
154
|
}
|
|
149
155
|
};
|
|
150
|
-
MonacoThemingService.toUpdateUiTheme = new disposable_1.DisposableCollection();
|
|
151
156
|
__decorate([
|
|
152
157
|
(0, inversify_1.inject)(file_service_1.FileService),
|
|
153
158
|
__metadata("design:type", file_service_1.FileService)
|
|
154
159
|
], MonacoThemingService.prototype, "fileService", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
(0, inversify_1.inject)(monaco_theme_registry_1.MonacoThemeRegistry),
|
|
162
|
+
__metadata("design:type", monaco_theme_registry_1.MonacoThemeRegistry)
|
|
163
|
+
], MonacoThemingService.prototype, "monacoThemeRegistry", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
(0, inversify_1.inject)(theming_1.ThemeService),
|
|
166
|
+
__metadata("design:type", theming_1.ThemeService)
|
|
167
|
+
], MonacoThemingService.prototype, "themeService", void 0);
|
|
155
168
|
MonacoThemingService = MonacoThemingService_1 = __decorate([
|
|
156
169
|
(0, inversify_1.injectable)()
|
|
157
170
|
], MonacoThemingService);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monaco-theming-service.js","sourceRoot":"","sources":["../../src/browser/monaco-theming-service.ts"],"names":[],"mappings":";AAAA,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;;;;;;;;;;;;;AAEhF,uDAAuD;AAEvD,4DAAkE;AAClE,4CAA4C;AAC5C,0CAA0C;AAC1C,6DAA+D;AAC/D,oDAA6C;AAC7C,kEAAqF;AACrF,4EAAuE;AACvE,2DAA0F;AAC1F,6EAAyE;AAiCzE,IAAa,oBAAoB,4BAAjC,MAAa,oBAAoB;
|
|
1
|
+
{"version":3,"file":"monaco-theming-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AAC,2CAAmB,CAAC;8BAAyC,2CAAmB;iEAAC;AACnE;IAArB,IAAA,kBAAM,EAAC,sBAAY,CAAC;8BAAkC,sBAAY;0DAAC;AAJ3D,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CAgJhC;AAhJY,oDAAoB"}
|
|
@@ -38,7 +38,7 @@ exports.default = (bind, unbind, isBound, rebind) => {
|
|
|
38
38
|
bind(browser_1.FrontendApplicationContribution).toService(monaco_textmate_service_1.MonacoTextmateService);
|
|
39
39
|
(0, core_1.bindContributionProvider)(bind, textmate_contribution_1.LanguageGrammarDefinitionContribution);
|
|
40
40
|
bind(textmate_registry_1.TextmateRegistry).toSelf().inSingletonScope();
|
|
41
|
-
bind(monaco_theme_registry_1.MonacoThemeRegistry).
|
|
41
|
+
bind(monaco_theme_registry_1.MonacoThemeRegistry).toSelf().inSingletonScope();
|
|
42
42
|
};
|
|
43
43
|
async function dynamicOnigasmLib(ctx) {
|
|
44
44
|
return createOnigasmLib();
|
|
@@ -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,uEAAkF;AAClF,mEAA8D;AAC9D,qCAA4D;AAG5D,MAAa,UAAU;IACnB,iBAAiB,CAAC,OAAiB;QAC/B,OAAO,IAAI,qBAAW,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IACD,gBAAgB,CAAC,OAAe;QAC5B,OAAO,IAAI,oBAAU,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;CACJ;AAPD,gCAOC;AAED,kBAAe,CAAC,IAAqB,EAAE,MAAyB,EAAE,OAA2B,EAAE,MAAyB,EAAE,EAAE;IACxH,IAAI,CAAC,wCAAc,CAAC,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC1E,IAAI,CAAC,+CAAqB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACxD,IAAI,CAAC,yCAA+B,CAAC,CAAC,SAAS,CAAC,+CAAqB,CAAC,CAAC;IACvE,IAAA,+BAAwB,EAAC,IAAI,EAAE,6DAAqC,CAAC,CAAC;IACtE,IAAI,CAAC,oCAAgB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACnD,IAAI,CAAC,2CAAmB,CAAC,CAAC,
|
|
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,uEAAkF;AAClF,mEAA8D;AAC9D,qCAA4D;AAG5D,MAAa,UAAU;IACnB,iBAAiB,CAAC,OAAiB;QAC/B,OAAO,IAAI,qBAAW,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IACD,gBAAgB,CAAC,OAAe;QAC5B,OAAO,IAAI,oBAAU,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;CACJ;AAPD,gCAOC;AAED,kBAAe,CAAC,IAAqB,EAAE,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: ThemeMix;
|
|
9
9
|
}
|
|
10
10
|
export declare class MonacoThemeRegistry {
|
|
11
|
+
initializeDefaultThemes(): void;
|
|
11
12
|
getThemeData(): ThemeMix;
|
|
12
13
|
getThemeData(name: string): ThemeMix | undefined;
|
|
13
14
|
getTheme(): MixStandaloneTheme;
|
|
@@ -24,9 +25,8 @@ export declare class MonacoThemeRegistry {
|
|
|
24
25
|
protected normalizeColor(color: string | Color | undefined): string | undefined;
|
|
25
26
|
}
|
|
26
27
|
export declare namespace MonacoThemeRegistry {
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const HC_DEFAULT_THEME: string;
|
|
28
|
+
const DARK_DEFAULT_THEME = "dark-theia";
|
|
29
|
+
const LIGHT_DEFAULT_THEME = "light-theia";
|
|
30
|
+
const HC_DEFAULT_THEME = "hc-theia";
|
|
31
31
|
}
|
|
32
32
|
//# sourceMappingURL=monaco-theme-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monaco-theme-registry.d.ts","sourceRoot":"","sources":["../../../src/browser/textmate/monaco-theme-registry.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAA2B,MAAM,2EAA2E,CAAC;AAGtI,OAAO,EAAE,KAAK,EAAE,MAAM,oDAAoD,CAAC;AAE3E,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,qBACa,mBAAmB;IAE5B,YAAY,IAAI,QAAQ;IACxB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAMhD,QAAQ,IAAI,kBAAkB;IAC9B,QAAQ,C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AAI,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;IAkErI,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"}
|
|
@@ -29,6 +29,19 @@ const monaco = require("@theia/monaco-editor-core");
|
|
|
29
29
|
const standaloneTheme_1 = require("@theia/monaco-editor-core/esm/vs/editor/standalone/common/standaloneTheme");
|
|
30
30
|
const standaloneServices_1 = require("@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices");
|
|
31
31
|
let MonacoThemeRegistry = class MonacoThemeRegistry {
|
|
32
|
+
initializeDefaultThemes() {
|
|
33
|
+
this.register(require('../../../data/monaco-themes/vscode/dark_theia.json'), {
|
|
34
|
+
'./dark_vs.json': require('../../../data/monaco-themes/vscode/dark_vs.json'),
|
|
35
|
+
'./dark_plus.json': require('../../../data/monaco-themes/vscode/dark_plus.json')
|
|
36
|
+
}, 'dark-theia', 'vs-dark');
|
|
37
|
+
this.register(require('../../../data/monaco-themes/vscode/light_theia.json'), {
|
|
38
|
+
'./light_vs.json': require('../../../data/monaco-themes/vscode/light_vs.json'),
|
|
39
|
+
'./light_plus.json': require('../../../data/monaco-themes/vscode/light_plus.json'),
|
|
40
|
+
}, 'light-theia', 'vs');
|
|
41
|
+
this.register(require('../../../data/monaco-themes/vscode/hc_theia.json'), {
|
|
42
|
+
'./hc_black.json': require('../../../data/monaco-themes/vscode/hc_black.json')
|
|
43
|
+
}, 'hc-theia', 'hc-black');
|
|
44
|
+
}
|
|
32
45
|
getThemeData(name) {
|
|
33
46
|
const theme = this.doGetTheme(name);
|
|
34
47
|
return theme && theme.themeData;
|
|
@@ -141,18 +154,9 @@ MonacoThemeRegistry = __decorate([
|
|
|
141
154
|
], MonacoThemeRegistry);
|
|
142
155
|
exports.MonacoThemeRegistry = MonacoThemeRegistry;
|
|
143
156
|
(function (MonacoThemeRegistry) {
|
|
144
|
-
MonacoThemeRegistry.
|
|
145
|
-
MonacoThemeRegistry.
|
|
146
|
-
|
|
147
|
-
'./dark_plus.json': require('../../../data/monaco-themes/vscode/dark_plus.json')
|
|
148
|
-
}, 'dark-theia', 'vs-dark').name;
|
|
149
|
-
MonacoThemeRegistry.LIGHT_DEFAULT_THEME = MonacoThemeRegistry.SINGLETON.register(require('../../../data/monaco-themes/vscode/light_theia.json'), {
|
|
150
|
-
'./light_vs.json': require('../../../data/monaco-themes/vscode/light_vs.json'),
|
|
151
|
-
'./light_plus.json': require('../../../data/monaco-themes/vscode/light_plus.json'),
|
|
152
|
-
}, 'light-theia', 'vs').name;
|
|
153
|
-
MonacoThemeRegistry.HC_DEFAULT_THEME = MonacoThemeRegistry.SINGLETON.register(require('../../../data/monaco-themes/vscode/hc_theia.json'), {
|
|
154
|
-
'./hc_black.json': require('../../../data/monaco-themes/vscode/hc_black.json')
|
|
155
|
-
}, 'hc-theia', 'hc-black').name;
|
|
157
|
+
MonacoThemeRegistry.DARK_DEFAULT_THEME = 'dark-theia';
|
|
158
|
+
MonacoThemeRegistry.LIGHT_DEFAULT_THEME = 'light-theia';
|
|
159
|
+
MonacoThemeRegistry.HC_DEFAULT_THEME = 'hc-theia';
|
|
156
160
|
})(MonacoThemeRegistry = exports.MonacoThemeRegistry || (exports.MonacoThemeRegistry = {}));
|
|
157
161
|
exports.MonacoThemeRegistry = MonacoThemeRegistry;
|
|
158
162
|
//# sourceMappingURL=monaco-theme-registry.js.map
|
|
@@ -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;;;;;;;;;AAEhF,uDAAuD;AAEvD,4DAA0D;AAC1D,qDAAwE;AACxE,oDAAoD;AACpD,+GAAsI;AACtI,sHAAmH;AAUnH,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;
|
|
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;AAC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AI,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;AAvIY,mBAAmB;IAD/B,IAAA,sBAAU,GAAE;GACA,mBAAmB,CAuI/B;AAvIY,kDAAmB;AAyIhC,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;AA7IY,kDAAmB"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/monaco",
|
|
3
|
-
"version": "1.27.0-next.
|
|
3
|
+
"version": "1.27.0-next.53+0e05d0ad8b9",
|
|
4
4
|
"description": "Theia - Monaco Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.27.0-next.
|
|
7
|
-
"@theia/editor": "1.27.0-next.
|
|
8
|
-
"@theia/filesystem": "1.27.0-next.
|
|
9
|
-
"@theia/markers": "1.27.0-next.
|
|
6
|
+
"@theia/core": "1.27.0-next.53+0e05d0ad8b9",
|
|
7
|
+
"@theia/editor": "1.27.0-next.53+0e05d0ad8b9",
|
|
8
|
+
"@theia/filesystem": "1.27.0-next.53+0e05d0ad8b9",
|
|
9
|
+
"@theia/markers": "1.27.0-next.53+0e05d0ad8b9",
|
|
10
10
|
"@theia/monaco-editor-core": "1.65.2",
|
|
11
|
-
"@theia/outline-view": "1.27.0-next.
|
|
11
|
+
"@theia/outline-view": "1.27.0-next.53+0e05d0ad8b9",
|
|
12
12
|
"fast-plist": "^0.1.2",
|
|
13
13
|
"idb": "^4.0.5",
|
|
14
14
|
"jsonc-parser": "^2.2.0",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"nyc": {
|
|
55
55
|
"extends": "../../configs/nyc.json"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "0e05d0ad8b91e3abd1d4d153f6c5215f181afbf9"
|
|
58
58
|
}
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { injectable } from '@theia/core/shared/inversify';
|
|
18
|
-
import { ColorRegistry
|
|
18
|
+
import { ColorRegistry } from '@theia/core/lib/browser/color-registry';
|
|
19
|
+
import { Color, ColorDefinition } from '@theia/core/lib/common/color';
|
|
19
20
|
import { Disposable } from '@theia/core/lib/common/disposable';
|
|
20
21
|
import { ColorDefaults, ColorValue, getColorRegistry } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/colorRegistry';
|
|
21
22
|
import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
18
|
-
import { FrontendApplicationContribution, PreferenceSchemaProvider, QuickAccessRegistry } from '@theia/core/lib/browser';
|
|
17
|
+
import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
|
|
18
|
+
import { ColorTheme, CssStyleCollector, FrontendApplicationContribution, PreferenceSchemaProvider, QuickAccessRegistry, StylingParticipant } from '@theia/core/lib/browser';
|
|
19
19
|
import { MonacoSnippetSuggestProvider } from './monaco-snippet-suggest-provider';
|
|
20
20
|
import * as monaco from '@theia/monaco-editor-core';
|
|
21
21
|
import { setSnippetSuggestSupport } from '@theia/monaco-editor-core/esm/vs/editor/contrib/suggest/browser/suggest';
|
|
@@ -29,9 +29,11 @@ import { ITextModelService } from '@theia/monaco-editor-core/esm/vs/editor/commo
|
|
|
29
29
|
import { IContextKeyService } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey';
|
|
30
30
|
import { IContextMenuService } from '@theia/monaco-editor-core/esm/vs/platform/contextview/browser/contextView';
|
|
31
31
|
import { MonacoContextMenuService } from './monaco-context-menu';
|
|
32
|
+
import { MonacoThemingService } from './monaco-theming-service';
|
|
33
|
+
import { isHighContrast } from '@theia/core/lib/common/theme';
|
|
32
34
|
|
|
33
35
|
@injectable()
|
|
34
|
-
export class MonacoFrontendApplicationContribution implements FrontendApplicationContribution {
|
|
36
|
+
export class MonacoFrontendApplicationContribution implements FrontendApplicationContribution, StylingParticipant {
|
|
35
37
|
|
|
36
38
|
@inject(MonacoEditorService)
|
|
37
39
|
protected readonly codeEditorService: MonacoEditorService;
|
|
@@ -54,7 +56,10 @@ export class MonacoFrontendApplicationContribution implements FrontendApplicatio
|
|
|
54
56
|
@inject(MonacoContextMenuService)
|
|
55
57
|
protected readonly contextMenuService: MonacoContextMenuService;
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
@inject(MonacoThemingService) protected readonly monacoThemingService: MonacoThemingService;
|
|
60
|
+
|
|
61
|
+
@postConstruct()
|
|
62
|
+
protected init(): void {
|
|
58
63
|
const { codeEditorService, textModelService, contextKeyService, contextMenuService } = this;
|
|
59
64
|
StandaloneServices.initialize({
|
|
60
65
|
[ICodeEditorService.toString()]: codeEditorService,
|
|
@@ -77,6 +82,53 @@ export class MonacoFrontendApplicationContribution implements FrontendApplicatio
|
|
|
77
82
|
this.preferenceSchema.registerOverrideIdentifier(language.id);
|
|
78
83
|
registerLanguage(language);
|
|
79
84
|
};
|
|
85
|
+
|
|
86
|
+
this.monacoThemingService.initialize();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
initialize(): void { }
|
|
90
|
+
|
|
91
|
+
registerThemeStyle(theme: ColorTheme, collector: CssStyleCollector): void {
|
|
92
|
+
if (isHighContrast(theme.type)) {
|
|
93
|
+
const focusBorder = theme.getColor('focusBorder');
|
|
94
|
+
const contrastBorder = theme.getColor('contrastBorder');
|
|
95
|
+
if (focusBorder) {
|
|
96
|
+
// Quick input
|
|
97
|
+
collector.addRule(`
|
|
98
|
+
.quick-input-list .monaco-list-row {
|
|
99
|
+
outline-offset: -1px;
|
|
100
|
+
}
|
|
101
|
+
.quick-input-list .monaco-list-row.focused {
|
|
102
|
+
outline: 1px dotted ${focusBorder};
|
|
103
|
+
}
|
|
104
|
+
.quick-input-list .monaco-list-row:hover {
|
|
105
|
+
outline: 1px dashed ${focusBorder};
|
|
106
|
+
}
|
|
107
|
+
`);
|
|
108
|
+
// Input box always displays an outline, even when unfocused
|
|
109
|
+
collector.addRule(`
|
|
110
|
+
.monaco-editor .find-widget .monaco-inputbox {
|
|
111
|
+
outline: var(--theia-border-width) solid;
|
|
112
|
+
outline-offset: calc(-1 * var(--theia-border-width));
|
|
113
|
+
outline-color: var(--theia-focusBorder);
|
|
114
|
+
}
|
|
115
|
+
`);
|
|
116
|
+
}
|
|
117
|
+
if (contrastBorder) {
|
|
118
|
+
collector.addRule(`
|
|
119
|
+
.quick-input-widget {
|
|
120
|
+
outline: 1px solid ${contrastBorder};
|
|
121
|
+
outline-offset: -1px;
|
|
122
|
+
}
|
|
123
|
+
`);
|
|
124
|
+
}
|
|
125
|
+
} else {
|
|
126
|
+
collector.addRule(`
|
|
127
|
+
.quick-input-widget {
|
|
128
|
+
box-shadow: rgb(0 0 0 / 36%) 0px 0px 8px 2px;
|
|
129
|
+
}
|
|
130
|
+
`);
|
|
131
|
+
}
|
|
80
132
|
}
|
|
81
133
|
|
|
82
134
|
}
|
|
@@ -38,7 +38,7 @@ import { MenuContribution, CommandContribution } from '@theia/core/lib/common';
|
|
|
38
38
|
import {
|
|
39
39
|
FrontendApplicationContribution, KeybindingContribution,
|
|
40
40
|
PreferenceService, PreferenceSchemaProvider, createPreferenceProxy,
|
|
41
|
-
PreferenceScope, PreferenceChange, OVERRIDE_PROPERTY_PATTERN, QuickInputService
|
|
41
|
+
PreferenceScope, PreferenceChange, OVERRIDE_PROPERTY_PATTERN, QuickInputService, StylingParticipant
|
|
42
42
|
} from '@theia/core/lib/browser';
|
|
43
43
|
import { TextEditorProvider, DiffNavigatorProvider } from '@theia/editor/lib/browser';
|
|
44
44
|
import { StrictEditorTextFocusContext } from '@theia/editor/lib/browser/editor-keybinding-contexts';
|
|
@@ -88,11 +88,11 @@ import { StandaloneConfigurationService, StandaloneServices } from '@theia/monac
|
|
|
88
88
|
import { Configuration } from '@theia/monaco-editor-core/esm/vs/platform/configuration/common/configurationModels';
|
|
89
89
|
import { MarkdownRenderer } from '@theia/core/lib/browser/markdown-rendering/markdown-renderer';
|
|
90
90
|
import { MonacoMarkdownRenderer } from './markdown-renderer/monaco-markdown-renderer';
|
|
91
|
+
import { ThemeService } from '@theia/core/lib/browser/theming';
|
|
92
|
+
import { ThemeServiceWithDB } from './monaco-indexed-db';
|
|
91
93
|
|
|
92
94
|
decorate(injectable(), VSCodeContextKeyService);
|
|
93
95
|
|
|
94
|
-
MonacoThemingService.init();
|
|
95
|
-
|
|
96
96
|
export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
97
97
|
bind(MonacoThemingService).toSelf().inSingletonScope();
|
|
98
98
|
|
|
@@ -100,7 +100,9 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
|
100
100
|
rebind(ContextKeyService).toService(MonacoContextKeyService);
|
|
101
101
|
|
|
102
102
|
bind(MonacoSnippetSuggestProvider).toSelf().inSingletonScope();
|
|
103
|
-
bind(
|
|
103
|
+
bind(MonacoFrontendApplicationContribution).toSelf().inSingletonScope();
|
|
104
|
+
bind(FrontendApplicationContribution).toService(MonacoFrontendApplicationContribution);
|
|
105
|
+
bind(StylingParticipant).toService(MonacoFrontendApplicationContribution);
|
|
104
106
|
|
|
105
107
|
bind(MonacoToProtocolConverter).toSelf().inSingletonScope();
|
|
106
108
|
bind(ProtocolToMonacoConverter).toSelf().inSingletonScope();
|
|
@@ -183,6 +185,9 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
|
183
185
|
|
|
184
186
|
bind(MonacoColorRegistry).toSelf().inSingletonScope();
|
|
185
187
|
rebind(ColorRegistry).toService(MonacoColorRegistry);
|
|
188
|
+
|
|
189
|
+
bind(ThemeServiceWithDB).toSelf().inSingletonScope();
|
|
190
|
+
rebind(ThemeService).toService(ThemeServiceWithDB);
|
|
186
191
|
});
|
|
187
192
|
|
|
188
193
|
export const MonacoConfigurationService = Symbol('MonacoConfigurationService');
|
|
@@ -16,9 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
import * as idb from 'idb';
|
|
18
18
|
import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
19
|
-
import {
|
|
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-registry';
|
|
23
|
+
import { Theme } from '@theia/core/lib/common/theme';
|
|
22
24
|
|
|
23
25
|
let _monacoDB: Promise<idb.IDBPDatabase> | undefined;
|
|
24
26
|
if ('indexedDB' in window) {
|
|
@@ -88,19 +90,12 @@ export async function deleteTheme(id: string): Promise<void> {
|
|
|
88
90
|
export function stateToTheme(state: MonacoThemeState): Theme {
|
|
89
91
|
const { id, label, description, uiTheme, data } = state;
|
|
90
92
|
const type = uiTheme === 'vs' ? 'light' : uiTheme === 'vs-dark' ? 'dark' : 'hc';
|
|
91
|
-
const builtInTheme = uiTheme === 'vs' ? BuiltinThemeProvider.lightCss : BuiltinThemeProvider.darkCss;
|
|
92
93
|
return {
|
|
93
94
|
type,
|
|
94
95
|
id,
|
|
95
96
|
label,
|
|
96
97
|
description,
|
|
97
|
-
editorTheme: data.name
|
|
98
|
-
activate(): void {
|
|
99
|
-
builtInTheme.use();
|
|
100
|
-
},
|
|
101
|
-
deactivate(): void {
|
|
102
|
-
builtInTheme.unuse();
|
|
103
|
-
}
|
|
98
|
+
editorTheme: data.name!
|
|
104
99
|
};
|
|
105
100
|
}
|
|
106
101
|
|
|
@@ -109,18 +104,8 @@ async function getThemeFromDB(id: string): Promise<Theme | undefined> {
|
|
|
109
104
|
return matchingState && stateToTheme(matchingState);
|
|
110
105
|
}
|
|
111
106
|
|
|
107
|
+
@injectable()
|
|
112
108
|
export class ThemeServiceWithDB extends ThemeService {
|
|
113
|
-
static override get(): ThemeService {
|
|
114
|
-
const global = window as any; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
115
|
-
if (!global[ThemeServiceSymbol]) {
|
|
116
|
-
const themeService = new ThemeServiceWithDB();
|
|
117
|
-
themeService.register(...BuiltinThemeProvider.themes);
|
|
118
|
-
themeService.startupTheme();
|
|
119
|
-
global[ThemeServiceSymbol] = themeService;
|
|
120
|
-
}
|
|
121
|
-
return global[ThemeServiceSymbol];
|
|
122
|
-
}
|
|
123
|
-
|
|
124
109
|
override loadUserTheme(): void {
|
|
125
110
|
this.loadUserThemeWithDB();
|
|
126
111
|
}
|
|
@@ -128,8 +113,11 @@ export class ThemeServiceWithDB extends ThemeService {
|
|
|
128
113
|
protected async loadUserThemeWithDB(): Promise<void> {
|
|
129
114
|
const themeId = window.localStorage.getItem('theme') || this.defaultTheme.id;
|
|
130
115
|
const theme = this.themes[themeId] ?? await getThemeFromDB(themeId) ?? this.defaultTheme;
|
|
116
|
+
// In case the theme comes from the DB.
|
|
117
|
+
if (!this.themes[theme.id]) {
|
|
118
|
+
this.themes[theme.id] = theme;
|
|
119
|
+
}
|
|
131
120
|
this.setCurrentTheme(theme.id);
|
|
121
|
+
this.deferredInitializer.resolve();
|
|
132
122
|
}
|
|
133
123
|
}
|
|
134
|
-
|
|
135
|
-
ThemeService.get = ThemeServiceWithDB.get;
|
|
@@ -488,11 +488,17 @@ class MonacoQuickPick<T extends QuickPickItem> extends MonacoQuickInput implemen
|
|
|
488
488
|
}
|
|
489
489
|
|
|
490
490
|
set items(itms: readonly (T | QuickPickSeparator)[]) {
|
|
491
|
+
// We need to store and apply the currently selected active items.
|
|
492
|
+
// Since monaco compares these items by reference equality, creating new wrapped items will unmark any active items.
|
|
493
|
+
// Assigning the `activeItems` again will restore all active items even after the items array has changed.
|
|
494
|
+
// See also the `findMonacoItemReferences` method.
|
|
495
|
+
const active = this.activeItems;
|
|
491
496
|
this.wrapped.items = itms.map(item => QuickPickSeparator.is(item) ? item : new MonacoQuickPickItem<T>(item, this.keybindingRegistry));
|
|
497
|
+
this.activeItems = active;
|
|
492
498
|
}
|
|
493
499
|
|
|
494
500
|
set activeItems(itms: readonly T[]) {
|
|
495
|
-
this.wrapped.activeItems =
|
|
501
|
+
this.wrapped.activeItems = this.findMonacoItemReferences(this.wrapped.items, itms);
|
|
496
502
|
}
|
|
497
503
|
|
|
498
504
|
get activeItems(): readonly (T)[] {
|
|
@@ -500,7 +506,7 @@ class MonacoQuickPick<T extends QuickPickItem> extends MonacoQuickInput implemen
|
|
|
500
506
|
}
|
|
501
507
|
|
|
502
508
|
set selectedItems(itms: readonly T[]) {
|
|
503
|
-
this.wrapped.selectedItems =
|
|
509
|
+
this.wrapped.selectedItems = this.findMonacoItemReferences(this.wrapped.items, itms);
|
|
504
510
|
}
|
|
505
511
|
|
|
506
512
|
get selectedItems(): readonly (T)[] {
|
|
@@ -520,6 +526,22 @@ class MonacoQuickPick<T extends QuickPickItem> extends MonacoQuickInput implemen
|
|
|
520
526
|
(items: MonacoQuickPickItem<T>[]) => items.map(item => item.item));
|
|
521
527
|
readonly onDidChangeSelection: Event<T[]> = Event.map(
|
|
522
528
|
this.wrapped.onDidChangeSelection, (items: MonacoQuickPickItem<T>[]) => items.map(item => item.item));
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Monaco doesn't check for deep equality when setting the `activeItems` or `selectedItems`.
|
|
532
|
+
* Instead we have to find the references of the monaco wrappers that contain the selected/active items
|
|
533
|
+
*/
|
|
534
|
+
protected findMonacoItemReferences(source: readonly (MonacoQuickPickItem<T> | IQuickPickSeparator)[], items: readonly QuickPickItem[]): MonacoQuickPickItem<T>[] {
|
|
535
|
+
const monacoReferences: MonacoQuickPickItem<T>[] = [];
|
|
536
|
+
for (const item of items) {
|
|
537
|
+
for (const wrappedItem of source) {
|
|
538
|
+
if (!QuickPickSeparator.is(wrappedItem) && wrappedItem.item === item) {
|
|
539
|
+
monacoReferences.push(wrappedItem);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
return monacoReferences;
|
|
544
|
+
}
|
|
523
545
|
}
|
|
524
546
|
|
|
525
547
|
export class MonacoQuickPickItem<T extends QuickPickItem> implements IQuickPickItem {
|
|
@@ -59,9 +59,11 @@ export interface MonacoThemeJson {
|
|
|
59
59
|
@injectable()
|
|
60
60
|
export class MonacoThemingService {
|
|
61
61
|
|
|
62
|
-
@inject(FileService)
|
|
63
|
-
protected readonly
|
|
62
|
+
@inject(FileService) protected readonly fileService: FileService;
|
|
63
|
+
@inject(MonacoThemeRegistry) protected readonly monacoThemeRegistry: MonacoThemeRegistry;
|
|
64
|
+
@inject(ThemeService) protected readonly themeService: ThemeService;
|
|
64
65
|
|
|
66
|
+
/** Register themes whose configuration needs to be loaded */
|
|
65
67
|
register(theme: MonacoTheme, pending: { [uri: string]: Promise<any> } = {}): Disposable {
|
|
66
68
|
const toDispose = new DisposableCollection(Disposable.create(() => { /* mark as not disposed */ }));
|
|
67
69
|
this.doRegister(theme, pending, toDispose);
|
|
@@ -80,7 +82,7 @@ export class MonacoThemingService {
|
|
|
80
82
|
}
|
|
81
83
|
const label = theme.label || new URI(theme.uri).path.base;
|
|
82
84
|
const { id, description, uiTheme } = theme;
|
|
83
|
-
toDispose.push(
|
|
85
|
+
toDispose.push(this.registerParsedTheme({ id, label, description, uiTheme: uiTheme, json, includes }));
|
|
84
86
|
} catch (e) {
|
|
85
87
|
console.error('Failed to load theme from ' + theme.uri, e);
|
|
86
88
|
}
|
|
@@ -137,43 +139,45 @@ export class MonacoThemingService {
|
|
|
137
139
|
return pending[referencedUri];
|
|
138
140
|
}
|
|
139
141
|
|
|
140
|
-
|
|
142
|
+
initialize(): void {
|
|
143
|
+
this.monacoThemeRegistry.initializeDefaultThemes();
|
|
141
144
|
this.updateBodyUiTheme();
|
|
142
|
-
|
|
145
|
+
this.themeService.onDidColorThemeChange(() => this.updateBodyUiTheme());
|
|
143
146
|
this.restore();
|
|
144
147
|
}
|
|
145
148
|
|
|
146
|
-
|
|
149
|
+
/** register a theme whose configuration has already been loaded */
|
|
150
|
+
registerParsedTheme(theme: MonacoThemeJson): Disposable {
|
|
147
151
|
const uiTheme = theme.uiTheme || 'vs-dark';
|
|
148
152
|
const { label, description, json, includes } = theme;
|
|
149
153
|
const id = theme.id || label;
|
|
150
154
|
const cssSelector = MonacoThemingService.toCssSelector(id);
|
|
151
|
-
const data =
|
|
152
|
-
return
|
|
155
|
+
const data = this.monacoThemeRegistry.register(json, includes, cssSelector, uiTheme);
|
|
156
|
+
return this.doRegisterParsedTheme({ id, label, description, uiTheme, data });
|
|
153
157
|
}
|
|
154
158
|
|
|
155
|
-
protected
|
|
156
|
-
protected
|
|
159
|
+
protected toUpdateUiTheme = new DisposableCollection();
|
|
160
|
+
protected updateBodyUiTheme(): void {
|
|
157
161
|
this.toUpdateUiTheme.dispose();
|
|
158
|
-
const type =
|
|
162
|
+
const type = this.themeService.getCurrentTheme().type;
|
|
159
163
|
const uiTheme: monaco.editor.BuiltinTheme = type === 'hc' ? 'hc-black' : type === 'light' ? 'vs' : 'vs-dark';
|
|
160
164
|
document.body.classList.add(uiTheme);
|
|
161
165
|
this.toUpdateUiTheme.push(Disposable.create(() => document.body.classList.remove(uiTheme)));
|
|
162
166
|
}
|
|
163
167
|
|
|
164
|
-
protected
|
|
168
|
+
protected doRegisterParsedTheme(state: MonacoThemeState): Disposable {
|
|
165
169
|
return new DisposableCollection(
|
|
166
|
-
|
|
170
|
+
this.themeService.register(stateToTheme(state)),
|
|
167
171
|
putTheme(state)
|
|
168
172
|
);
|
|
169
173
|
}
|
|
170
174
|
|
|
171
|
-
protected
|
|
175
|
+
protected async restore(): Promise<void> {
|
|
172
176
|
try {
|
|
173
177
|
const themes = await getThemes();
|
|
174
178
|
for (const state of themes) {
|
|
175
|
-
|
|
176
|
-
|
|
179
|
+
this.monacoThemeRegistry.setTheme(state.data.name!, state.data);
|
|
180
|
+
this.doRegisterParsedTheme(state);
|
|
177
181
|
}
|
|
178
182
|
} catch (e) {
|
|
179
183
|
console.error('Failed to restore monaco themes', e);
|