@codingame/monaco-vscode-theme-service-override 1.82.6 → 1.83.0-next.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-theme-service-override",
3
- "version": "1.82.6",
3
+ "version": "1.83.0-next.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,7 +18,7 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@1.82.6",
22
- "monaco-editor": "0.43.0"
21
+ "vscode": "npm:@codingame/monaco-vscode-api@1.83.0-next.0",
22
+ "monaco-editor": "0.44.0"
23
23
  }
24
24
  }
@@ -66,6 +66,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
66
66
  this.extensionResourceLoaderService = extensionResourceLoaderService;
67
67
  this.logService = logService;
68
68
  this.hostColorService = hostColorService;
69
+ this.userDataInitializationService = userDataInitializationService;
69
70
  this.hasDefaultUpdated = false;
70
71
  this.themeExtensionsActivated = ( (new Map()));
71
72
  this.container = layoutService.container;
@@ -134,7 +135,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
134
135
  if (productIconData) {
135
136
  this.applyAndSetProductIconTheme(productIconData, true);
136
137
  }
137
- Promise.all([extensionService.whenInstalledExtensionsRegistered(), userDataInitializationService.whenInitializationFinished()]).then(_ => {
138
+ extensionService.whenInstalledExtensionsRegistered().then(_ => {
138
139
  this.installConfigurationListener();
139
140
  this.installPreferredSchemeListener();
140
141
  this.installRegistryListeners();
@@ -158,16 +159,20 @@ let WorkbenchThemeService = class WorkbenchThemeService {
158
159
  if (devThemes.length) {
159
160
  return this.setColorTheme(devThemes[0].id, 8 );
160
161
  }
161
- const fallbackTheme = this.currentColorTheme.type === ColorScheme.LIGHT ? ThemeSettingDefaults.COLOR_THEME_LIGHT : ThemeSettingDefaults.COLOR_THEME_DARK;
162
- const theme = this.colorThemeRegistry.findThemeBySettingsId(this.settings.colorTheme, fallbackTheme);
163
162
  const preferredColorScheme = this.getPreferredColorScheme();
164
163
  const prevScheme = this.storageService.get(PERSISTED_OS_COLOR_SCHEME, PERSISTED_OS_COLOR_SCHEME_SCOPE);
165
164
  if (preferredColorScheme !== prevScheme) {
166
165
  this.storageService.store(PERSISTED_OS_COLOR_SCHEME, preferredColorScheme, PERSISTED_OS_COLOR_SCHEME_SCOPE, 0 );
167
- if (preferredColorScheme && theme?.type !== preferredColorScheme) {
166
+ if (preferredColorScheme && this.currentColorTheme.type !== preferredColorScheme) {
168
167
  return this.applyPreferredColorTheme(preferredColorScheme);
169
168
  }
170
169
  }
170
+ let theme = this.colorThemeRegistry.findThemeBySettingsId(this.settings.colorTheme, undefined);
171
+ if (!theme) {
172
+ await this.userDataInitializationService.whenInitializationFinished();
173
+ const fallbackTheme = this.currentColorTheme.type === ColorScheme.LIGHT ? ThemeSettingDefaults.COLOR_THEME_LIGHT : ThemeSettingDefaults.COLOR_THEME_DARK;
174
+ theme = this.colorThemeRegistry.findThemeBySettingsId(this.settings.colorTheme, fallbackTheme);
175
+ }
171
176
  return this.setColorTheme(theme && theme.id, undefined);
172
177
  };
173
178
  const initializeFileIconTheme = async () => {
@@ -175,7 +180,11 @@ let WorkbenchThemeService = class WorkbenchThemeService {
175
180
  if (devThemes.length) {
176
181
  return this.setFileIconTheme(devThemes[0].id, 8 );
177
182
  }
178
- const theme = this.fileIconThemeRegistry.findThemeBySettingsId(this.settings.fileIconTheme);
183
+ let theme = this.fileIconThemeRegistry.findThemeBySettingsId(this.settings.fileIconTheme);
184
+ if (!theme) {
185
+ await this.userDataInitializationService.whenInitializationFinished();
186
+ theme = this.fileIconThemeRegistry.findThemeBySettingsId(this.settings.fileIconTheme);
187
+ }
179
188
  return this.setFileIconTheme(theme ? theme.id : DEFAULT_FILE_ICON_THEME_ID, undefined);
180
189
  };
181
190
  const initializeProductIconTheme = async () => {
@@ -183,7 +192,11 @@ let WorkbenchThemeService = class WorkbenchThemeService {
183
192
  if (devThemes.length) {
184
193
  return this.setProductIconTheme(devThemes[0].id, 8 );
185
194
  }
186
- const theme = this.productIconThemeRegistry.findThemeBySettingsId(this.settings.productIconTheme);
195
+ let theme = this.productIconThemeRegistry.findThemeBySettingsId(this.settings.productIconTheme);
196
+ if (!theme) {
197
+ await this.userDataInitializationService.whenInitializationFinished();
198
+ theme = this.productIconThemeRegistry.findThemeBySettingsId(this.settings.productIconTheme);
199
+ }
187
200
  return this.setProductIconTheme(theme ? theme.id : DEFAULT_PRODUCT_ICON_THEME_ID, undefined);
188
201
  };
189
202
  return Promise.all([initializeColorTheme(), initializeFileIconTheme(), initializeProductIconTheme()]);
@@ -1,5 +1,5 @@
1
1
  import { Color } from 'monaco-editor/esm/vs/base/common/color.js';
2
- import * as colors from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
2
+ import * as colorRegistry from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
3
3
  import * as editorColorRegistry from 'monaco-editor/esm/vs/editor/common/core/editorColorRegistry.js';
4
4
 
5
5
  const settingToColorIdMapping = {};
@@ -39,17 +39,17 @@ function convertSettings(oldSettings, result) {
39
39
  }
40
40
  }
41
41
  }
42
- addSettingMapping('background', colors.editorBackground);
43
- addSettingMapping('foreground', colors.editorForeground);
44
- addSettingMapping('selection', colors.editorSelectionBackground);
45
- addSettingMapping('inactiveSelection', colors.editorInactiveSelection);
46
- addSettingMapping('selectionHighlightColor', colors.editorSelectionHighlight);
47
- addSettingMapping('findMatchHighlight', colors.editorFindMatchHighlight);
48
- addSettingMapping('currentFindMatchHighlight', colors.editorFindMatch);
49
- addSettingMapping('hoverHighlight', colors.editorHoverHighlight);
42
+ addSettingMapping('background', colorRegistry.editorBackground);
43
+ addSettingMapping('foreground', colorRegistry.editorForeground);
44
+ addSettingMapping('selection', colorRegistry.editorSelectionBackground);
45
+ addSettingMapping('inactiveSelection', colorRegistry.editorInactiveSelection);
46
+ addSettingMapping('selectionHighlightColor', colorRegistry.editorSelectionHighlight);
47
+ addSettingMapping('findMatchHighlight', colorRegistry.editorFindMatchHighlight);
48
+ addSettingMapping('currentFindMatchHighlight', colorRegistry.editorFindMatch);
49
+ addSettingMapping('hoverHighlight', colorRegistry.editorHoverHighlight);
50
50
  addSettingMapping('wordHighlight', 'editor.wordHighlightBackground');
51
51
  addSettingMapping('wordHighlightStrong', 'editor.wordHighlightStrongBackground');
52
- addSettingMapping('findRangeHighlight', colors.editorFindRangeHighlight);
52
+ addSettingMapping('findRangeHighlight', colorRegistry.editorFindRangeHighlight);
53
53
  addSettingMapping('findMatchHighlight', 'peekViewResult.matchHighlightBackground');
54
54
  addSettingMapping('referenceHighlight', 'peekViewEditor.matchHighlightBackground');
55
55
  addSettingMapping('lineHighlight', editorColorRegistry.editorLineHighlight);