@codingame/monaco-vscode-theme-service-override 28.4.0 → 29.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-theme-service-override",
3
- "version": "28.4.0",
3
+ "version": "29.0.0",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor - theme service-override",
6
6
  "keywords": [],
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-api": "28.4.0",
19
- "@codingame/monaco-vscode-files-service-override": "28.4.0"
18
+ "@codingame/monaco-vscode-api": "29.0.0",
19
+ "@codingame/monaco-vscode-files-service-override": "29.0.0"
20
20
  },
21
21
  "main": "index.js",
22
22
  "module": "index.js",
@@ -6,7 +6,7 @@ import { registerAction2, Action2, MenuId, MenuRegistry } from '@codingame/monac
6
6
  import { equalsIgnoreCase } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
7
7
  import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
8
8
  import { Categories } from '@codingame/monaco-vscode-api/vscode/vs/platform/action/common/actionCommonCategories';
9
- import { ThemeSettings } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/themes/common/workbenchThemeService';
9
+ import { ThemeSettings, ThemeSettingDefaults } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/themes/common/workbenchThemeService';
10
10
  import { IWorkbenchThemeService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/themes/common/workbenchThemeService.service';
11
11
  import { IExtensionsWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions.service';
12
12
  import { IExtensionGalleryService, IExtensionManagementService } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensionManagement/common/extensionManagement.service';
@@ -52,7 +52,7 @@ import { IPreferencesService } from '@codingame/monaco-vscode-api/vscode/vs/work
52
52
  import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
53
53
  import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
54
54
 
55
- const manageExtensionIcon = registerIcon("theme-selection-manage-extension", Codicon.gear, ( localize(14369, "Icon for the 'Manage' action in the theme selection quick pick.")));
55
+ const manageExtensionIcon = registerIcon("theme-selection-manage-extension", Codicon.gear, ( localize(14631, "Icon for the 'Manage' action in the theme selection quick pick.")));
56
56
  var ConfigureItem;
57
57
  (function(ConfigureItem) {
58
58
  ConfigureItem["BROWSE_GALLERY"] = "marketplace";
@@ -178,7 +178,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
178
178
  quickpick.matchOnDescription = true;
179
179
  quickpick.buttons = [this.quickInputService.backButton];
180
180
  quickpick.title = "Marketplace Themes";
181
- quickpick.placeholder = ( localize(14370, "Type to Search More. Select to Install. Up/Down Keys to Preview"));
181
+ quickpick.placeholder = ( localize(14632, "Type to Search More. Select to Install. Up/Down Keys to Preview"));
182
182
  quickpick.canSelectMany = false;
183
183
  disposables.add(quickpick.onDidChangeValue(() => this.trigger(quickpick.value)));
184
184
  disposables.add(quickpick.onDidAccept(async _ => {
@@ -232,7 +232,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
232
232
  });
233
233
  } else if (items.length === 0 && this._searchError) {
234
234
  items = [{
235
- label: `$(error) ${( localize(14371, "Error while searching for themes: {0}", this._searchError))}`,
235
+ label: `$(error) ${( localize(14633, "Error while searching for themes: {0}", this._searchError))}`,
236
236
  id: undefined,
237
237
  alwaysShow: true
238
238
  }];
@@ -254,12 +254,12 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
254
254
  this.extensionsWorkbenchService.openSearch(`@id:${galleryExtension.identifier.id}`);
255
255
  const result = await this.dialogService.confirm({
256
256
  message: ( localize(
257
- 14372,
257
+ 14634,
258
258
  "This will install extension '{0}' published by '{1}'. Do you want to continue?",
259
259
  galleryExtension.displayName,
260
260
  galleryExtension.publisherDisplayName
261
261
  )),
262
- primaryButton: ( localize(14373, "OK"))
262
+ primaryButton: ( localize(14635, "OK"))
263
263
  });
264
264
  if (!result.confirmed) {
265
265
  return false;
@@ -267,7 +267,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
267
267
  try {
268
268
  await this.progressService.withProgress({
269
269
  location: ProgressLocation.Notification,
270
- title: ( localize(14374, "Installing Extension {0}...", galleryExtension.displayName))
270
+ title: ( localize(14636, "Installing Extension {0}...", galleryExtension.displayName))
271
271
  }, async () => {
272
272
  await this.extensionManagementService.installFromGallery(galleryExtension, {
273
273
  isMachineScoped: false
@@ -418,7 +418,7 @@ registerAction2(class extends Action2 {
418
418
  constructor() {
419
419
  super({
420
420
  id: SelectColorThemeCommandId,
421
- title: ( localize2(14375, "Color Theme")),
421
+ title: ( localize2(14637, "Color Theme")),
422
422
  category: Categories.Preferences,
423
423
  f1: true,
424
424
  keybinding: {
@@ -430,15 +430,15 @@ registerAction2(class extends Action2 {
430
430
  getTitle(colorScheme) {
431
431
  switch (colorScheme) {
432
432
  case ColorScheme.DARK:
433
- return localize(14376, "Select Color Theme for System Dark Mode");
433
+ return localize(14638, "Select Color Theme for System Dark Mode");
434
434
  case ColorScheme.LIGHT:
435
- return localize(14377, "Select Color Theme for System Light Mode");
435
+ return localize(14639, "Select Color Theme for System Light Mode");
436
436
  case ColorScheme.HIGH_CONTRAST_DARK:
437
- return localize(14378, "Select Color Theme for High Contrast Dark Mode");
437
+ return localize(14640, "Select Color Theme for High Contrast Dark Mode");
438
438
  case ColorScheme.HIGH_CONTRAST_LIGHT:
439
- return localize(14379, "Select Color Theme for High Contrast Light Mode");
439
+ return localize(14641, "Select Color Theme for High Contrast Light Mode");
440
440
  default:
441
- return localize(14380, "Select Color Theme (detect system color mode disabled)");
441
+ return localize(14642, "Select Color Theme (detect system color mode disabled)");
442
442
  }
443
443
  }
444
444
  async run(accessor) {
@@ -446,13 +446,13 @@ registerAction2(class extends Action2 {
446
446
  const preferencesService = accessor.get(IPreferencesService);
447
447
  const preferredColorScheme = themeService.getPreferredColorScheme();
448
448
  const modeConfigureButton = {
449
- tooltip: preferredColorScheme ? ( localize(14381, "Detect system color mode enabled. Click to configure.")) : ( localize(14382, "Detect system color mode disabled. Click to configure.")),
449
+ tooltip: preferredColorScheme ? ( localize(14643, "Detect system color mode enabled. Click to configure.")) : ( localize(14644, "Detect system color mode disabled. Click to configure.")),
450
450
  iconClass: ThemeIcon.asClassName(Codicon.colorMode),
451
451
  location: QuickInputButtonLocation.Inline
452
452
  };
453
453
  const options = {
454
- installMessage: ( localize(14383, "Install Additional Color Themes...")),
455
- browseMessage: "$(plus) " + ( localize(14384, "Browse Additional Color Themes...")),
454
+ installMessage: ( localize(14645, "Install Additional Color Themes...")),
455
+ browseMessage: "$(plus) " + ( localize(14646, "Browse Additional Color Themes...")),
456
456
  placeholderMessage: this.getTitle(preferredColorScheme),
457
457
  marketplaceTag: "category:themes",
458
458
  buttons: [modeConfigureButton],
@@ -469,9 +469,9 @@ registerAction2(class extends Action2 {
469
469
  const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
470
470
  const themes = await themeService.getColorThemes();
471
471
  const currentTheme = themeService.getColorTheme();
472
- const lightEntries = toEntries(themes.filter(t => t.type === ColorScheme.LIGHT), ( localize(14385, "light themes")));
473
- const darkEntries = toEntries(themes.filter(t => t.type === ColorScheme.DARK), ( localize(14386, "dark themes")));
474
- const hcEntries = toEntries(themes.filter(t => isHighContrast(t.type)), ( localize(14387, "high contrast themes")));
472
+ const lightEntries = toEntries(themes.filter(t => t.type === ColorScheme.LIGHT), ( localize(14647, "light themes")));
473
+ const darkEntries = toEntries(themes.filter(t => t.type === ColorScheme.DARK), ( localize(14648, "dark themes")));
474
+ const hcEntries = toEntries(themes.filter(t => isHighContrast(t.type)), ( localize(14649, "high contrast themes")));
475
475
  let picks;
476
476
  switch (preferredColorScheme) {
477
477
  case ColorScheme.DARK:
@@ -494,7 +494,7 @@ registerAction2(class extends Action2 {
494
494
  constructor() {
495
495
  super({
496
496
  id: SelectFileIconThemeCommandId,
497
- title: ( localize2(14388, "File Icon Theme")),
497
+ title: ( localize2(14650, "File Icon Theme")),
498
498
  category: Categories.Preferences,
499
499
  f1: true
500
500
  });
@@ -502,8 +502,8 @@ registerAction2(class extends Action2 {
502
502
  async run(accessor) {
503
503
  const themeService = accessor.get(IWorkbenchThemeService);
504
504
  const options = {
505
- installMessage: ( localize(14389, "Install Additional File Icon Themes...")),
506
- placeholderMessage: ( localize(14390, "Select File Icon Theme (Up/Down Keys to Preview)")),
505
+ installMessage: ( localize(14651, "Install Additional File Icon Themes...")),
506
+ placeholderMessage: ( localize(14652, "Select File Icon Theme (Up/Down Keys to Preview)")),
507
507
  marketplaceTag: "tag:icon-theme"
508
508
  };
509
509
  const setTheme = (theme, settingsTarget) => themeService.setFileIconTheme(theme, settingsTarget);
@@ -512,12 +512,12 @@ registerAction2(class extends Action2 {
512
512
  const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
513
513
  const picks = [{
514
514
  type: "separator",
515
- label: ( localize(14391, "file icon themes"))
515
+ label: ( localize(14653, "file icon themes"))
516
516
  }, {
517
517
  id: "",
518
518
  theme: FileIconThemeData.noIconTheme,
519
- label: ( localize(14392, "None")),
520
- description: ( localize(14393, "Disable File Icons"))
519
+ label: ( localize(14654, "None")),
520
+ description: ( localize(14655, "Disable File Icons"))
521
521
  }, ...toEntries(await themeService.getFileIconThemes())];
522
522
  await picker.openQuickPick(picks, themeService.getFileIconTheme());
523
523
  }
@@ -527,7 +527,7 @@ registerAction2(class extends Action2 {
527
527
  constructor() {
528
528
  super({
529
529
  id: SelectProductIconThemeCommandId,
530
- title: ( localize2(14394, "Product Icon Theme")),
530
+ title: ( localize2(14656, "Product Icon Theme")),
531
531
  category: Categories.Preferences,
532
532
  f1: true
533
533
  });
@@ -535,9 +535,9 @@ registerAction2(class extends Action2 {
535
535
  async run(accessor) {
536
536
  const themeService = accessor.get(IWorkbenchThemeService);
537
537
  const options = {
538
- installMessage: ( localize(14395, "Install Additional Product Icon Themes...")),
539
- browseMessage: "$(plus) " + ( localize(14396, "Browse Additional Product Icon Themes...")),
540
- placeholderMessage: ( localize(14397, "Select Product Icon Theme (Up/Down Keys to Preview)")),
538
+ installMessage: ( localize(14657, "Install Additional Product Icon Themes...")),
539
+ browseMessage: "$(plus) " + ( localize(14658, "Browse Additional Product Icon Themes...")),
540
+ placeholderMessage: ( localize(14659, "Select Product Icon Theme (Up/Down Keys to Preview)")),
541
541
  marketplaceTag: "tag:product-icon-theme"
542
542
  };
543
543
  const setTheme = (theme, settingsTarget) => themeService.setProductIconTheme(theme, settingsTarget);
@@ -546,15 +546,92 @@ registerAction2(class extends Action2 {
546
546
  const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
547
547
  const picks = [{
548
548
  type: "separator",
549
- label: ( localize(14398, "product icon themes"))
549
+ label: ( localize(14660, "product icon themes"))
550
550
  }, {
551
551
  id: DEFAULT_PRODUCT_ICON_THEME_ID,
552
552
  theme: ProductIconThemeData.defaultTheme,
553
- label: ( localize(14399, "Default"))
553
+ label: ( localize(14661, "Default"))
554
554
  }, ...toEntries(await themeService.getProductIconThemes())];
555
555
  await picker.openQuickPick(picks, themeService.getProductIconTheme());
556
556
  }
557
557
  });
558
+ registerAction2(class extends Action2 {
559
+ constructor() {
560
+ super({
561
+ id: "workbench.action.tryNewDefaultThemes",
562
+ title: ( localize2(14662, "Try New Default Themes")),
563
+ category: Categories.Preferences,
564
+ f1: true
565
+ });
566
+ }
567
+ async run(accessor) {
568
+ const themeService = accessor.get(IWorkbenchThemeService);
569
+ const quickInputService = accessor.get(IQuickInputService);
570
+ const configurationService = accessor.get(IConfigurationService);
571
+ const previousTheme = themeService.getColorTheme();
572
+ const allThemes = await themeService.getColorThemes();
573
+ const newThemeSettingsIds = ( new Set([
574
+ ThemeSettingDefaults.COLOR_THEME_LIGHT,
575
+ ThemeSettingDefaults.COLOR_THEME_DARK
576
+ ]));
577
+ const themes = allThemes.filter(t => ( newThemeSettingsIds.has(t.settingsId)));
578
+ const items = ( themes.map(t => ({
579
+ id: t.id,
580
+ label: t.label,
581
+ description: t.description
582
+ })));
583
+ const disposables = ( new DisposableStore());
584
+ const picker = disposables.add(quickInputService.createQuickPick());
585
+ picker.items = items;
586
+ picker.placeholder = ( localize(14663, "Pick a new default theme"));
587
+ picker.canSelectMany = false;
588
+ const preferredId = (previousTheme.type === ColorScheme.LIGHT || previousTheme.type === ColorScheme.HIGH_CONTRAST_LIGHT) ? ThemeSettingDefaults.COLOR_THEME_LIGHT : ThemeSettingDefaults.COLOR_THEME_DARK;
589
+ const activeItem = items.find(i => themes.find(t => t.id === i.id)?.settingsId === preferredId);
590
+ if (activeItem) {
591
+ picker.activeItems = [activeItem];
592
+ }
593
+ disposables.add(picker.onDidChangeActive(selected => {
594
+ if (selected[0]) {
595
+ const theme = themes.find(t => t.id === selected[0].id);
596
+ if (theme) {
597
+ themeService.setColorTheme(theme, "preview");
598
+ }
599
+ }
600
+ }));
601
+ disposables.add(picker.onDidAccept(() => {
602
+ const selected = picker.activeItems[0];
603
+ const theme = selected ? themes.find(t => t.id === selected.id) : undefined;
604
+ picker.hide();
605
+ if (!theme) {
606
+ return;
607
+ }
608
+ (async () => {
609
+ try {
610
+ await themeService.setColorTheme(theme, "auto");
611
+ await configurationService.updateValue(
612
+ ThemeSettings.PREFERRED_LIGHT_THEME,
613
+ ThemeSettingDefaults.COLOR_THEME_LIGHT
614
+ );
615
+ await configurationService.updateValue(ThemeSettings.PREFERRED_DARK_THEME, ThemeSettingDefaults.COLOR_THEME_DARK);
616
+ } catch (error) {
617
+ if (!isCancellationError(error)) {
618
+ onUnexpectedError(error);
619
+ }
620
+ }
621
+ })();
622
+ }));
623
+ const result = ( new Promise(resolve => {
624
+ disposables.add(picker.onDidHide(() => {
625
+ if (!picker.selectedItems.length) {
626
+ themeService.setColorTheme(previousTheme, undefined);
627
+ }
628
+ resolve();
629
+ }));
630
+ })).finally(() => disposables.dispose());
631
+ picker.show();
632
+ return result;
633
+ }
634
+ });
558
635
  CommandsRegistry.registerCommand(
559
636
  "workbench.action.previewColorTheme",
560
637
  async function(accessor, extension, themeSettingsId) {
@@ -591,13 +668,17 @@ function configurationEntry(label, configureItem) {
591
668
  function isItem(i) {
592
669
  return i["type"] !== "separator";
593
670
  }
671
+ const defaultThemeDescriptions = {
672
+ [ThemeSettingDefaults.COLOR_THEME_LIGHT]: ( localize(14664, "Default Light")),
673
+ [ThemeSettingDefaults.COLOR_THEME_DARK]: ( localize(14665, "Default Dark"))
674
+ };
594
675
  function toEntry(theme) {
595
676
  const settingId = theme.settingsId ?? undefined;
596
677
  const item = {
597
678
  id: theme.id,
598
679
  theme: theme,
599
680
  label: theme.label,
600
- description: theme.description || (theme.label === settingId ? undefined : settingId)
681
+ description: defaultThemeDescriptions[settingId ?? ""] ?? theme.description ?? (theme.label === settingId ? undefined : settingId)
601
682
  };
602
683
  if (theme.extensionData) {
603
684
  item.buttons = [configureButton];
@@ -605,7 +686,18 @@ function toEntry(theme) {
605
686
  return item;
606
687
  }
607
688
  function toEntries(themes, label) {
608
- const sorter = (t1, t2) => t1.label.localeCompare(t2.label);
689
+ const pinnedIds = ( new Set([
690
+ ThemeSettingDefaults.COLOR_THEME_DARK,
691
+ ThemeSettingDefaults.COLOR_THEME_LIGHT
692
+ ]));
693
+ const sorter = (t1, t2) => {
694
+ const pin1 = ( pinnedIds.has(t1.theme?.settingsId ?? ""));
695
+ const pin2 = ( pinnedIds.has(t2.theme?.settingsId ?? ""));
696
+ if (pin1 !== pin2) {
697
+ return pin1 ? -1 : 1;
698
+ }
699
+ return t1.label.localeCompare(t2.label);
700
+ };
609
701
  const entries = ( themes.map(toEntry)).sort(sorter);
610
702
  if (entries.length > 0 && label) {
611
703
  entries.unshift({
@@ -617,13 +709,13 @@ function toEntries(themes, label) {
617
709
  }
618
710
  const configureButton = {
619
711
  iconClass: ThemeIcon.asClassName(manageExtensionIcon),
620
- tooltip: ( localize(14400, "Manage Extension"))
712
+ tooltip: ( localize(14666, "Manage Extension"))
621
713
  };
622
714
  registerAction2(class extends Action2 {
623
715
  constructor() {
624
716
  super({
625
717
  id: "workbench.action.generateColorTheme",
626
- title: ( localize2(14401, "Generate Color Theme From Current Settings")),
718
+ title: ( localize2(14667, "Generate Color Theme From Current Settings")),
627
719
  category: Categories.Developer,
628
720
  f1: true
629
721
  });
@@ -678,7 +770,7 @@ registerAction2(class extends Action2 {
678
770
  constructor() {
679
771
  super({
680
772
  id: toggleLightDarkThemesCommandId,
681
- title: ( localize2(14402, "Toggle between Light/Dark Themes")),
773
+ title: ( localize2(14668, "Toggle between Light/Dark Themes")),
682
774
  category: Categories.Preferences,
683
775
  f1: true
684
776
  });
@@ -690,12 +782,12 @@ registerAction2(class extends Action2 {
690
782
  const preferencesService = accessor.get(IPreferencesService);
691
783
  if (configurationService.getValue(ThemeSettings.DETECT_COLOR_SCHEME)) {
692
784
  const message = ( localize(
693
- 14403,
785
+ 14669,
694
786
  "Cannot toggle between light and dark themes when `{0}` is enabled in settings.",
695
787
  ThemeSettings.DETECT_COLOR_SCHEME
696
788
  ));
697
789
  notificationService.prompt(Severity.Info, message, [{
698
- label: ( localize(14404, "Open Settings")),
790
+ label: ( localize(14670, "Open Settings")),
699
791
  run: () => {
700
792
  return preferencesService.openUserSettings({
701
793
  query: ThemeSettings.DETECT_COLOR_SCHEME
@@ -734,7 +826,7 @@ registerAction2(class extends Action2 {
734
826
  constructor() {
735
827
  super({
736
828
  id: browseColorThemesInMarketplaceCommandId,
737
- title: ( localize2(14405, "Browse Color Themes in Marketplace")),
829
+ title: ( localize2(14671, "Browse Color Themes in Marketplace")),
738
830
  category: Categories.Preferences,
739
831
  f1: true
740
832
  });
@@ -775,13 +867,13 @@ registerAction2(class extends Action2 {
775
867
  });
776
868
  const ThemesSubMenu = ( new MenuId("ThemesSubMenu"));
777
869
  MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
778
- title: ( localize(14406, "Themes")),
870
+ title: ( localize(14672, "Themes")),
779
871
  submenu: ThemesSubMenu,
780
872
  group: "2_configuration",
781
873
  order: 7
782
874
  });
783
875
  MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
784
- title: ( localize(14407, "&&Themes")),
876
+ title: ( localize(14673, "&&Themes")),
785
877
  submenu: ThemesSubMenu,
786
878
  group: "2_configuration",
787
879
  order: 7
@@ -789,21 +881,21 @@ MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
789
881
  MenuRegistry.appendMenuItem(ThemesSubMenu, {
790
882
  command: {
791
883
  id: SelectColorThemeCommandId,
792
- title: ( localize(14375, "Color Theme"))
884
+ title: ( localize(14637, "Color Theme"))
793
885
  },
794
886
  order: 1
795
887
  });
796
888
  MenuRegistry.appendMenuItem(ThemesSubMenu, {
797
889
  command: {
798
890
  id: SelectFileIconThemeCommandId,
799
- title: ( localize(14408, "File Icon Theme"))
891
+ title: ( localize(14674, "File Icon Theme"))
800
892
  },
801
893
  order: 2
802
894
  });
803
895
  MenuRegistry.appendMenuItem(ThemesSubMenu, {
804
896
  command: {
805
897
  id: SelectProductIconThemeCommandId,
806
- title: ( localize(14409, "Product Icon Theme"))
898
+ title: ( localize(14675, "Product Icon Theme"))
807
899
  },
808
900
  order: 3
809
901
  });
@@ -149,12 +149,12 @@ class FileIconThemeLoader {
149
149
  const contentValue = parse(content, errors);
150
150
  if (errors.length > 0) {
151
151
  return Promise.reject(( new Error(( localize(
152
- 16029,
152
+ 16325,
153
153
  "Problems parsing file icons file: {0}",
154
154
  ( errors.map(e => getParseErrorMessage(e.error))).join(", ")
155
155
  )))));
156
156
  } else if (getNodeType(contentValue) !== "object") {
157
- return Promise.reject(( new Error(( localize(16030, "Invalid format for file icons theme file: Object expected.")))));
157
+ return Promise.reject(( new Error(( localize(16326, "Invalid format for file icons theme file: Object expected.")))));
158
158
  }
159
159
  return Promise.resolve(contentValue);
160
160
  });
@@ -43,7 +43,7 @@ class ProductIconThemeData {
43
43
  this.isLoaded = true;
44
44
  if (warnings.length) {
45
45
  logService.error(( localize(
46
- 16031,
46
+ 16327,
47
47
  "Problems processing product icons definitions in {0}:\n{1}",
48
48
  (location.toString()),
49
49
  warnings.join("\n")
@@ -76,7 +76,7 @@ class ProductIconThemeData {
76
76
  static get defaultTheme() {
77
77
  let themeData = ProductIconThemeData._defaultProductIconTheme;
78
78
  if (!themeData) {
79
- themeData = ProductIconThemeData._defaultProductIconTheme = ( new ProductIconThemeData(DEFAULT_PRODUCT_ICON_THEME_ID, ( localize(16032, "Default")), ThemeSettingDefaults.PRODUCT_ICON_THEME));
79
+ themeData = ProductIconThemeData._defaultProductIconTheme = ( new ProductIconThemeData(DEFAULT_PRODUCT_ICON_THEME_ID, ( localize(16328, "Default")), ThemeSettingDefaults.PRODUCT_ICON_THEME));
80
80
  themeData.isLoaded = true;
81
81
  themeData.extensionData = undefined;
82
82
  themeData.watch = false;
@@ -187,15 +187,15 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
187
187
  const contentValue = parse(content, parseErrors);
188
188
  if (parseErrors.length > 0) {
189
189
  return Promise.reject(( new Error(( localize(
190
- 16033,
190
+ 16329,
191
191
  "Problems parsing product icons file: {0}",
192
192
  ( parseErrors.map(e => getParseErrorMessage(e.error))).join(", ")
193
193
  )))));
194
194
  } else if (getNodeType(contentValue) !== "object") {
195
- return Promise.reject(( new Error(( localize(16034, "Invalid format for product icons theme file: Object expected.")))));
195
+ return Promise.reject(( new Error(( localize(16330, "Invalid format for product icons theme file: Object expected.")))));
196
196
  } else if (!contentValue.iconDefinitions || !Array.isArray(contentValue.fonts) || !contentValue.fonts.length) {
197
197
  return Promise.reject(( new Error(( localize(
198
- 16035,
198
+ 16331,
199
199
  "Invalid format for product icons theme file: Must contain iconDefinitions and fonts."
200
200
  )))));
201
201
  }
@@ -208,13 +208,13 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
208
208
  if (isString(font.weight) && font.weight.match(fontWeightRegex)) {
209
209
  fontWeight = font.weight;
210
210
  } else {
211
- warnings.push(( localize(16036, "Invalid font weight in font '{0}'. Ignoring setting.", font.id)));
211
+ warnings.push(( localize(16332, "Invalid font weight in font '{0}'. Ignoring setting.", font.id)));
212
212
  }
213
213
  let fontStyle = undefined;
214
214
  if (isString(font.style) && font.style.match(fontStyleRegex)) {
215
215
  fontStyle = font.style;
216
216
  } else {
217
- warnings.push(( localize(16037, "Invalid font style in font '{0}'. Ignoring setting.", font.id)));
217
+ warnings.push(( localize(16333, "Invalid font style in font '{0}'. Ignoring setting.", font.id)));
218
218
  }
219
219
  const sanitizedSrc = [];
220
220
  if (Array.isArray(font.src)) {
@@ -226,7 +226,7 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
226
226
  format: s.format
227
227
  });
228
228
  } else {
229
- warnings.push(( localize(16038, "Invalid font source in font '{0}'. Ignoring source.", font.id)));
229
+ warnings.push(( localize(16334, "Invalid font source in font '{0}'. Ignoring source.", font.id)));
230
230
  }
231
231
  }
232
232
  }
@@ -238,14 +238,14 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
238
238
  });
239
239
  } else {
240
240
  warnings.push(( localize(
241
- 16039,
241
+ 16335,
242
242
  "No valid font source in font '{0}'. Ignoring font definition.",
243
243
  font.id
244
244
  )));
245
245
  }
246
246
  } else {
247
247
  warnings.push(( localize(
248
- 16040,
248
+ 16336,
249
249
  "Missing or invalid font id '{0}'. Skipping font definition.",
250
250
  font.id
251
251
  )));
@@ -268,10 +268,10 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
268
268
  font
269
269
  });
270
270
  } else {
271
- warnings.push(( localize(16041, "Skipping icon definition '{0}'. Unknown font.", iconId)));
271
+ warnings.push(( localize(16337, "Skipping icon definition '{0}'. Unknown font.", iconId)));
272
272
  }
273
273
  } else {
274
- warnings.push(( localize(16042, "Skipping icon definition '{0}': Needs to be defined", iconId)));
274
+ warnings.push(( localize(16338, "Skipping icon definition '{0}': Needs to be defined", iconId)));
275
275
  }
276
276
  }
277
277
  return {
@@ -17,6 +17,8 @@ import { ColorScheme } from "@codingame/monaco-vscode-api/vscode/vs/platform/the
17
17
  import { IHostColorSchemeService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/themes/common/hostColorSchemeService.service";
18
18
  import { IUserDataInitializationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/userData/browser/userDataInit.service";
19
19
  import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service";
20
+ import { INotificationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service";
21
+ import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
20
22
  export declare class WorkbenchThemeService extends Disposable implements IWorkbenchThemeService {
21
23
  private readonly storageService;
22
24
  private readonly configurationService;
@@ -27,6 +29,8 @@ export declare class WorkbenchThemeService extends Disposable implements IWorkbe
27
29
  private readonly hostColorService;
28
30
  private readonly userDataInitializationService;
29
31
  private readonly languageService;
32
+ private readonly notificationService;
33
+ private readonly commandService;
30
34
  readonly _serviceBrand: undefined;
31
35
  private readonly container;
32
36
  private settings;
@@ -47,8 +51,20 @@ export declare class WorkbenchThemeService extends Disposable implements IWorkbe
47
51
  private readonly onProductIconThemeChange;
48
52
  private readonly productIconThemeWatcher;
49
53
  private readonly productIconThemeSequencer;
50
- constructor(extensionService: IExtensionService, storageService: IStorageService, configurationService: IConfigurationService, telemetryService: ITelemetryService, environmentService: IBrowserWorkbenchEnvironmentService, fileService: IFileService, extensionResourceLoaderService: IExtensionResourceLoaderService, layoutService: IWorkbenchLayoutService, logService: ILogService, hostColorService: IHostColorSchemeService, userDataInitializationService: IUserDataInitializationService, languageService: ILanguageService);
54
+ constructor(extensionService: IExtensionService, storageService: IStorageService, configurationService: IConfigurationService, telemetryService: ITelemetryService, environmentService: IBrowserWorkbenchEnvironmentService, fileService: IFileService, extensionResourceLoaderService: IExtensionResourceLoaderService, layoutService: IWorkbenchLayoutService, logService: ILogService, hostColorService: IHostColorSchemeService, userDataInitializationService: IUserDataInitializationService, languageService: ILanguageService, notificationService: INotificationService, commandService: ICommandService);
51
55
  private initialize;
56
+ private static readonly NEW_THEME_NOTIFICATION_KEY;
57
+ private showNewDefaultThemeNotification;
58
+ /**
59
+ * Migrates legacy theme setting values to their current equivalents,
60
+ * writing back the migrated value so settings sync distributes the correct ID.
61
+ */
62
+ private migrateColorThemeSettings;
63
+ /**
64
+ * For new users who haven't explicitly configured `window.autoDetectColorScheme`,
65
+ * persist `true` so that auto-detect becomes the default going forward.
66
+ */
67
+ private migrateAutoDetectColorScheme;
52
68
  private installConfigurationListener;
53
69
  private installRegistryListeners;
54
70
  private installPreferredSchemeListener;