@codingame/monaco-vscode-theme-service-override 15.0.2 → 16.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 +9 -6
- package/vscode/src/vs/workbench/contrib/themes/browser/themes.contribution.js +43 -43
- package/vscode/src/vs/workbench/services/themes/browser/fileIconThemeData.js +2 -2
- package/vscode/src/vs/workbench/services/themes/browser/productIconThemeData.js +12 -12
- package/vscode/src/vs/workbench/services/themes/browser/workbenchThemeService.d.ts +2 -2
- package/vscode/src/vs/workbench/services/themes/browser/workbenchThemeService.js +7 -7
- package/vscode/src/vs/workbench/services/themes/common/colorThemeSchema.js +13 -13
- package/vscode/src/vs/workbench/services/themes/common/fileIconThemeSchema.js +38 -38
- package/vscode/src/vs/workbench/services/themes/common/productIconThemeSchema.js +7 -7
- package/vscode/src/vs/workbench/services/themes/common/themeConfiguration.js +36 -36
- package/vscode/src/vs/workbench/services/themes/common/themeExtensionPoints.js +21 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-theme-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - theme service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-411e0589-fa79-504b-b32c-80a88847b23a-common": "
|
|
19
|
-
"@codingame/monaco-vscode-7ba0af96-90c2-5e11-ad7f-befdbbf246c8-common": "
|
|
20
|
-
"@codingame/monaco-vscode-9d0168a3-519b-57f3-9bcc-89efc41f951a-common": "
|
|
21
|
-
"@codingame/monaco-vscode-api": "
|
|
22
|
-
"@codingame/monaco-vscode-files-service-override": "
|
|
18
|
+
"@codingame/monaco-vscode-411e0589-fa79-504b-b32c-80a88847b23a-common": "16.0.0",
|
|
19
|
+
"@codingame/monaco-vscode-7ba0af96-90c2-5e11-ad7f-befdbbf246c8-common": "16.0.0",
|
|
20
|
+
"@codingame/monaco-vscode-9d0168a3-519b-57f3-9bcc-89efc41f951a-common": "16.0.0",
|
|
21
|
+
"@codingame/monaco-vscode-api": "16.0.0",
|
|
22
|
+
"@codingame/monaco-vscode-files-service-override": "16.0.0"
|
|
23
23
|
},
|
|
24
24
|
"main": "index.js",
|
|
25
25
|
"module": "index.js",
|
|
@@ -28,6 +28,9 @@
|
|
|
28
28
|
".": {
|
|
29
29
|
"default": "./index.js"
|
|
30
30
|
},
|
|
31
|
+
"./vscode/*.css": {
|
|
32
|
+
"default": "./vscode/src/*.css"
|
|
33
|
+
},
|
|
31
34
|
"./vscode/*": {
|
|
32
35
|
"types": "./vscode/src/*.d.ts",
|
|
33
36
|
"default": "./vscode/src/*.js"
|
|
@@ -53,7 +53,7 @@ import { defaultToggleStyles } from '@codingame/monaco-vscode-api/vscode/vs/plat
|
|
|
53
53
|
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
54
54
|
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
55
55
|
|
|
56
|
-
const manageExtensionIcon = registerIcon('theme-selection-manage-extension', Codicon.gear, ( localize(
|
|
56
|
+
const manageExtensionIcon = registerIcon('theme-selection-manage-extension', Codicon.gear, ( localize(10985, 'Icon for the \'Manage\' action in the theme selection quick pick.')));
|
|
57
57
|
var ConfigureItem;
|
|
58
58
|
(function (ConfigureItem) {
|
|
59
59
|
ConfigureItem["BROWSE_GALLERY"] = "marketplace";
|
|
@@ -161,7 +161,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
161
161
|
quickpick.matchOnDescription = true;
|
|
162
162
|
quickpick.buttons = [this.quickInputService.backButton];
|
|
163
163
|
quickpick.title = 'Marketplace Themes';
|
|
164
|
-
quickpick.placeholder = ( localize(
|
|
164
|
+
quickpick.placeholder = ( localize(10986, "Type to Search More. Select to Install. Up/Down Keys to Preview"));
|
|
165
165
|
quickpick.canSelectMany = false;
|
|
166
166
|
disposables.add(quickpick.onDidChangeValue(() => this.trigger(quickpick.value)));
|
|
167
167
|
disposables.add(quickpick.onDidAccept(async (_) => {
|
|
@@ -213,7 +213,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
213
213
|
items = items.concat({ label: '$(loading~spin) Searching for themes...', id: undefined, alwaysShow: true });
|
|
214
214
|
}
|
|
215
215
|
else if (items.length === 0 && this._searchError) {
|
|
216
|
-
items = [{ label: `$(error) ${( localize(
|
|
216
|
+
items = [{ label: `$(error) ${( localize(10987, 'Error while searching for themes: {0}', this._searchError))}`, id: undefined, alwaysShow: true }];
|
|
217
217
|
}
|
|
218
218
|
const activeItemId = quickpick.activeItems[0]?.id;
|
|
219
219
|
const newActiveItem = activeItemId ? items.find(i => isItem(i) && i.id === activeItemId) : undefined;
|
|
@@ -232,12 +232,12 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
232
232
|
this.extensionsWorkbenchService.openSearch(`@id:${galleryExtension.identifier.id}`);
|
|
233
233
|
const result = await this.dialogService.confirm({
|
|
234
234
|
message: ( localize(
|
|
235
|
-
|
|
235
|
+
10988,
|
|
236
236
|
"This will install extension '{0}' published by '{1}'. Do you want to continue?",
|
|
237
237
|
galleryExtension.displayName,
|
|
238
238
|
galleryExtension.publisherDisplayName
|
|
239
239
|
)),
|
|
240
|
-
primaryButton: ( localize(
|
|
240
|
+
primaryButton: ( localize(10989, "OK"))
|
|
241
241
|
});
|
|
242
242
|
if (!result.confirmed) {
|
|
243
243
|
return false;
|
|
@@ -245,7 +245,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
245
245
|
try {
|
|
246
246
|
await this.progressService.withProgress({
|
|
247
247
|
location: ProgressLocation.Notification,
|
|
248
|
-
title: ( localize(
|
|
248
|
+
title: ( localize(10990, "Installing Extension {0}...", galleryExtension.displayName))
|
|
249
249
|
}, async () => {
|
|
250
250
|
await this.extensionManagementService.installFromGallery(galleryExtension, {
|
|
251
251
|
isMachineScoped: false,
|
|
@@ -291,7 +291,7 @@ let InstalledThemesPicker = class InstalledThemesPicker {
|
|
|
291
291
|
async openQuickPick(picks, currentTheme) {
|
|
292
292
|
let marketplaceThemePicker;
|
|
293
293
|
if (this.extensionGalleryService.isEnabled()) {
|
|
294
|
-
if (this.extensionResourceLoaderService.supportsExtensionGalleryResources && this.options.browseMessage) {
|
|
294
|
+
if ((await this.extensionResourceLoaderService.supportsExtensionGalleryResources()) && this.options.browseMessage) {
|
|
295
295
|
marketplaceThemePicker = this.instantiationService.createInstance(MarketplaceThemesPicker, this.getMarketplaceColorThemes.bind(this), this.options.marketplaceTag);
|
|
296
296
|
picks = [configurationEntry(this.options.browseMessage, ConfigureItem.BROWSE_GALLERY), ...picks];
|
|
297
297
|
}
|
|
@@ -392,7 +392,7 @@ registerAction2(class extends Action2 {
|
|
|
392
392
|
constructor() {
|
|
393
393
|
super({
|
|
394
394
|
id: SelectColorThemeCommandId,
|
|
395
|
-
title: ( localize2(
|
|
395
|
+
title: ( localize2(10991, 'Color Theme')),
|
|
396
396
|
category: Categories.Preferences,
|
|
397
397
|
f1: true,
|
|
398
398
|
keybinding: {
|
|
@@ -403,12 +403,12 @@ registerAction2(class extends Action2 {
|
|
|
403
403
|
}
|
|
404
404
|
getTitle(colorScheme) {
|
|
405
405
|
switch (colorScheme) {
|
|
406
|
-
case ColorScheme.DARK: return localize(
|
|
407
|
-
case ColorScheme.LIGHT: return localize(
|
|
408
|
-
case ColorScheme.HIGH_CONTRAST_DARK: return localize(
|
|
409
|
-
case ColorScheme.HIGH_CONTRAST_LIGHT: return localize(
|
|
406
|
+
case ColorScheme.DARK: return localize(10992, "Select Color Theme for System Dark Mode");
|
|
407
|
+
case ColorScheme.LIGHT: return localize(10993, "Select Color Theme for System Light Mode");
|
|
408
|
+
case ColorScheme.HIGH_CONTRAST_DARK: return localize(10994, "Select Color Theme for High Contrast Dark Mode");
|
|
409
|
+
case ColorScheme.HIGH_CONTRAST_LIGHT: return localize(10995, "Select Color Theme for High Contrast Light Mode");
|
|
410
410
|
default:
|
|
411
|
-
return localize(
|
|
411
|
+
return localize(10996, "Select Color Theme (detect system color mode disabled)");
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
414
|
async run(accessor) {
|
|
@@ -418,7 +418,7 @@ registerAction2(class extends Action2 {
|
|
|
418
418
|
let modeConfigureToggle;
|
|
419
419
|
if (preferredColorScheme) {
|
|
420
420
|
modeConfigureToggle = ( new Toggle({
|
|
421
|
-
title: ( localize(
|
|
421
|
+
title: ( localize(10997, 'Detect system color mode enabled. Click to configure.')),
|
|
422
422
|
icon: Codicon.colorMode,
|
|
423
423
|
isChecked: false,
|
|
424
424
|
...defaultToggleStyles
|
|
@@ -426,15 +426,15 @@ registerAction2(class extends Action2 {
|
|
|
426
426
|
}
|
|
427
427
|
else {
|
|
428
428
|
modeConfigureToggle = ( new Toggle({
|
|
429
|
-
title: ( localize(
|
|
429
|
+
title: ( localize(10998, 'Detect system color mode disabled. Click to configure.')),
|
|
430
430
|
icon: Codicon.colorMode,
|
|
431
431
|
isChecked: false,
|
|
432
432
|
...defaultToggleStyles
|
|
433
433
|
}));
|
|
434
434
|
}
|
|
435
435
|
const options = {
|
|
436
|
-
installMessage: ( localize(
|
|
437
|
-
browseMessage: '$(plus) ' + ( localize(
|
|
436
|
+
installMessage: ( localize(10999, "Install Additional Color Themes...")),
|
|
437
|
+
browseMessage: '$(plus) ' + ( localize(11000, "Browse Additional Color Themes...")),
|
|
438
438
|
placeholderMessage: this.getTitle(preferredColorScheme),
|
|
439
439
|
marketplaceTag: 'category:themes',
|
|
440
440
|
toggles: [modeConfigureToggle],
|
|
@@ -449,9 +449,9 @@ registerAction2(class extends Action2 {
|
|
|
449
449
|
const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
|
|
450
450
|
const themes = await themeService.getColorThemes();
|
|
451
451
|
const currentTheme = themeService.getColorTheme();
|
|
452
|
-
const lightEntries = toEntries(themes.filter(t => t.type === ColorScheme.LIGHT), ( localize(
|
|
453
|
-
const darkEntries = toEntries(themes.filter(t => t.type === ColorScheme.DARK), ( localize(
|
|
454
|
-
const hcEntries = toEntries(themes.filter(t => isHighContrast(t.type)), ( localize(
|
|
452
|
+
const lightEntries = toEntries(themes.filter(t => t.type === ColorScheme.LIGHT), ( localize(11001, "light themes")));
|
|
453
|
+
const darkEntries = toEntries(themes.filter(t => t.type === ColorScheme.DARK), ( localize(11002, "dark themes")));
|
|
454
|
+
const hcEntries = toEntries(themes.filter(t => isHighContrast(t.type)), ( localize(11003, "high contrast themes")));
|
|
455
455
|
let picks;
|
|
456
456
|
switch (preferredColorScheme) {
|
|
457
457
|
case ColorScheme.DARK:
|
|
@@ -474,7 +474,7 @@ registerAction2(class extends Action2 {
|
|
|
474
474
|
constructor() {
|
|
475
475
|
super({
|
|
476
476
|
id: SelectFileIconThemeCommandId,
|
|
477
|
-
title: ( localize2(
|
|
477
|
+
title: ( localize2(11004, 'File Icon Theme')),
|
|
478
478
|
category: Categories.Preferences,
|
|
479
479
|
f1: true
|
|
480
480
|
});
|
|
@@ -482,8 +482,8 @@ registerAction2(class extends Action2 {
|
|
|
482
482
|
async run(accessor) {
|
|
483
483
|
const themeService = accessor.get(IWorkbenchThemeService);
|
|
484
484
|
const options = {
|
|
485
|
-
installMessage: ( localize(
|
|
486
|
-
placeholderMessage: ( localize(
|
|
485
|
+
installMessage: ( localize(11005, "Install Additional File Icon Themes...")),
|
|
486
|
+
placeholderMessage: ( localize(11006, "Select File Icon Theme (Up/Down Keys to Preview)")),
|
|
487
487
|
marketplaceTag: 'tag:icon-theme'
|
|
488
488
|
};
|
|
489
489
|
const setTheme = (theme, settingsTarget) => themeService.setFileIconTheme(theme, settingsTarget);
|
|
@@ -491,8 +491,8 @@ registerAction2(class extends Action2 {
|
|
|
491
491
|
const instantiationService = accessor.get(IInstantiationService);
|
|
492
492
|
const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
|
|
493
493
|
const picks = [
|
|
494
|
-
{ type: 'separator', label: ( localize(
|
|
495
|
-
{ id: '', theme: FileIconThemeData.noIconTheme, label: ( localize(
|
|
494
|
+
{ type: 'separator', label: ( localize(11007, 'file icon themes')) },
|
|
495
|
+
{ id: '', theme: FileIconThemeData.noIconTheme, label: ( localize(11008, 'None')), description: ( localize(11009, 'Disable File Icons')) },
|
|
496
496
|
...toEntries(await themeService.getFileIconThemes()),
|
|
497
497
|
];
|
|
498
498
|
await picker.openQuickPick(picks, themeService.getFileIconTheme());
|
|
@@ -503,7 +503,7 @@ registerAction2(class extends Action2 {
|
|
|
503
503
|
constructor() {
|
|
504
504
|
super({
|
|
505
505
|
id: SelectProductIconThemeCommandId,
|
|
506
|
-
title: ( localize2(
|
|
506
|
+
title: ( localize2(11010, 'Product Icon Theme')),
|
|
507
507
|
category: Categories.Preferences,
|
|
508
508
|
f1: true
|
|
509
509
|
});
|
|
@@ -511,9 +511,9 @@ registerAction2(class extends Action2 {
|
|
|
511
511
|
async run(accessor) {
|
|
512
512
|
const themeService = accessor.get(IWorkbenchThemeService);
|
|
513
513
|
const options = {
|
|
514
|
-
installMessage: ( localize(
|
|
515
|
-
browseMessage: '$(plus) ' + ( localize(
|
|
516
|
-
placeholderMessage: ( localize(
|
|
514
|
+
installMessage: ( localize(11011, "Install Additional Product Icon Themes...")),
|
|
515
|
+
browseMessage: '$(plus) ' + ( localize(11012, "Browse Additional Product Icon Themes...")),
|
|
516
|
+
placeholderMessage: ( localize(11013, "Select Product Icon Theme (Up/Down Keys to Preview)")),
|
|
517
517
|
marketplaceTag: 'tag:product-icon-theme'
|
|
518
518
|
};
|
|
519
519
|
const setTheme = (theme, settingsTarget) => themeService.setProductIconTheme(theme, settingsTarget);
|
|
@@ -521,8 +521,8 @@ registerAction2(class extends Action2 {
|
|
|
521
521
|
const instantiationService = accessor.get(IInstantiationService);
|
|
522
522
|
const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
|
|
523
523
|
const picks = [
|
|
524
|
-
{ type: 'separator', label: ( localize(
|
|
525
|
-
{ id: DEFAULT_PRODUCT_ICON_THEME_ID, theme: ProductIconThemeData.defaultTheme, label: ( localize(
|
|
524
|
+
{ type: 'separator', label: ( localize(11014, 'product icon themes')) },
|
|
525
|
+
{ id: DEFAULT_PRODUCT_ICON_THEME_ID, theme: ProductIconThemeData.defaultTheme, label: ( localize(11015, 'Default')) },
|
|
526
526
|
...toEntries(await themeService.getProductIconThemes()),
|
|
527
527
|
];
|
|
528
528
|
await picker.openQuickPick(picks, themeService.getProductIconTheme());
|
|
@@ -580,13 +580,13 @@ function toEntries(themes, label) {
|
|
|
580
580
|
}
|
|
581
581
|
const configureButton = {
|
|
582
582
|
iconClass: ThemeIcon.asClassName(manageExtensionIcon),
|
|
583
|
-
tooltip: ( localize(
|
|
583
|
+
tooltip: ( localize(11016, "Manage Extension")),
|
|
584
584
|
};
|
|
585
585
|
registerAction2(class extends Action2 {
|
|
586
586
|
constructor() {
|
|
587
587
|
super({
|
|
588
588
|
id: 'workbench.action.generateColorTheme',
|
|
589
|
-
title: ( localize2(
|
|
589
|
+
title: ( localize2(11017, 'Generate Color Theme From Current Settings')),
|
|
590
590
|
category: Categories.Developer,
|
|
591
591
|
f1: true
|
|
592
592
|
});
|
|
@@ -636,7 +636,7 @@ registerAction2(class extends Action2 {
|
|
|
636
636
|
constructor() {
|
|
637
637
|
super({
|
|
638
638
|
id: toggleLightDarkThemesCommandId,
|
|
639
|
-
title: ( localize2(
|
|
639
|
+
title: ( localize2(11018, 'Toggle between Light/Dark Themes')),
|
|
640
640
|
category: Categories.Preferences,
|
|
641
641
|
f1: true,
|
|
642
642
|
});
|
|
@@ -648,13 +648,13 @@ registerAction2(class extends Action2 {
|
|
|
648
648
|
const preferencesService = accessor.get(IPreferencesService);
|
|
649
649
|
if (configurationService.getValue(ThemeSettings.DETECT_COLOR_SCHEME)) {
|
|
650
650
|
const message = ( localize(
|
|
651
|
-
|
|
651
|
+
11019,
|
|
652
652
|
"Cannot toggle between light and dark themes when `{0}` is enabled in settings.",
|
|
653
653
|
ThemeSettings.DETECT_COLOR_SCHEME
|
|
654
654
|
));
|
|
655
655
|
notificationService.prompt(Severity.Info, message, [
|
|
656
656
|
{
|
|
657
|
-
label: ( localize(
|
|
657
|
+
label: ( localize(11020, "Open Settings")),
|
|
658
658
|
run: () => {
|
|
659
659
|
return preferencesService.openUserSettings({ query: ThemeSettings.DETECT_COLOR_SCHEME });
|
|
660
660
|
}
|
|
@@ -692,7 +692,7 @@ registerAction2(class extends Action2 {
|
|
|
692
692
|
constructor() {
|
|
693
693
|
super({
|
|
694
694
|
id: browseColorThemesInMarketplaceCommandId,
|
|
695
|
-
title: ( localize2(
|
|
695
|
+
title: ( localize2(11021, 'Browse Color Themes in Marketplace')),
|
|
696
696
|
category: Categories.Preferences,
|
|
697
697
|
f1: true,
|
|
698
698
|
});
|
|
@@ -703,7 +703,7 @@ registerAction2(class extends Action2 {
|
|
|
703
703
|
const extensionGalleryService = accessor.get(IExtensionGalleryService);
|
|
704
704
|
const extensionResourceLoaderService = accessor.get(IExtensionResourceLoaderService);
|
|
705
705
|
const instantiationService = accessor.get(IInstantiationService);
|
|
706
|
-
if (!extensionGalleryService.isEnabled() || !extensionResourceLoaderService.supportsExtensionGalleryResources) {
|
|
706
|
+
if (!extensionGalleryService.isEnabled() || !(await extensionResourceLoaderService.supportsExtensionGalleryResources())) {
|
|
707
707
|
return;
|
|
708
708
|
}
|
|
709
709
|
const currentTheme = themeService.getColorTheme();
|
|
@@ -728,13 +728,13 @@ registerAction2(class extends Action2 {
|
|
|
728
728
|
});
|
|
729
729
|
const ThemesSubMenu = ( new MenuId('ThemesSubMenu'));
|
|
730
730
|
MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
|
|
731
|
-
title: ( localize(
|
|
731
|
+
title: ( localize(11022, "Themes")),
|
|
732
732
|
submenu: ThemesSubMenu,
|
|
733
733
|
group: '2_configuration',
|
|
734
734
|
order: 7
|
|
735
735
|
});
|
|
736
736
|
MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
|
|
737
|
-
title: ( localize(
|
|
737
|
+
title: ( localize(11023, "&&Themes")),
|
|
738
738
|
submenu: ThemesSubMenu,
|
|
739
739
|
group: '2_configuration',
|
|
740
740
|
order: 7
|
|
@@ -742,21 +742,21 @@ MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
|
|
|
742
742
|
MenuRegistry.appendMenuItem(ThemesSubMenu, {
|
|
743
743
|
command: {
|
|
744
744
|
id: SelectColorThemeCommandId,
|
|
745
|
-
title: ( localize(
|
|
745
|
+
title: ( localize(10991, 'Color Theme'))
|
|
746
746
|
},
|
|
747
747
|
order: 1
|
|
748
748
|
});
|
|
749
749
|
MenuRegistry.appendMenuItem(ThemesSubMenu, {
|
|
750
750
|
command: {
|
|
751
751
|
id: SelectFileIconThemeCommandId,
|
|
752
|
-
title: ( localize(
|
|
752
|
+
title: ( localize(11024, "File Icon Theme"))
|
|
753
753
|
},
|
|
754
754
|
order: 2
|
|
755
755
|
});
|
|
756
756
|
MenuRegistry.appendMenuItem(ThemesSubMenu, {
|
|
757
757
|
command: {
|
|
758
758
|
id: SelectProductIconThemeCommandId,
|
|
759
|
-
title: ( localize(
|
|
759
|
+
title: ( localize(11025, "Product Icon Theme"))
|
|
760
760
|
},
|
|
761
761
|
order: 3
|
|
762
762
|
});
|
|
@@ -141,13 +141,13 @@ class FileIconThemeLoader {
|
|
|
141
141
|
const contentValue = parse(content, errors);
|
|
142
142
|
if (errors.length > 0) {
|
|
143
143
|
return Promise.reject(( new Error(( localize(
|
|
144
|
-
|
|
144
|
+
12478,
|
|
145
145
|
"Problems parsing file icons file: {0}",
|
|
146
146
|
( errors.map(e => getParseErrorMessage(e.error))).join(', ')
|
|
147
147
|
)))));
|
|
148
148
|
}
|
|
149
149
|
else if (getNodeType(contentValue) !== 'object') {
|
|
150
|
-
return Promise.reject(( new Error(( localize(
|
|
150
|
+
return Promise.reject(( new Error(( localize(12479, "Invalid format for file icons theme file: Object expected.")))));
|
|
151
151
|
}
|
|
152
152
|
return Promise.resolve(contentValue);
|
|
153
153
|
});
|
|
@@ -39,7 +39,7 @@ class ProductIconThemeData {
|
|
|
39
39
|
this.isLoaded = true;
|
|
40
40
|
if (warnings.length) {
|
|
41
41
|
logService.error(( localize(
|
|
42
|
-
|
|
42
|
+
12480,
|
|
43
43
|
"Problems processing product icons definitions in {0}:\n{1}",
|
|
44
44
|
(location.toString()),
|
|
45
45
|
warnings.join('\n')
|
|
@@ -70,7 +70,7 @@ class ProductIconThemeData {
|
|
|
70
70
|
static get defaultTheme() {
|
|
71
71
|
let themeData = ProductIconThemeData._defaultProductIconTheme;
|
|
72
72
|
if (!themeData) {
|
|
73
|
-
themeData = ProductIconThemeData._defaultProductIconTheme = ( new ProductIconThemeData(DEFAULT_PRODUCT_ICON_THEME_ID, ( localize(
|
|
73
|
+
themeData = ProductIconThemeData._defaultProductIconTheme = ( new ProductIconThemeData(DEFAULT_PRODUCT_ICON_THEME_ID, ( localize(12481, 'Default')), ThemeSettingDefaults.PRODUCT_ICON_THEME));
|
|
74
74
|
themeData.isLoaded = true;
|
|
75
75
|
themeData.extensionData = undefined;
|
|
76
76
|
themeData.watch = false;
|
|
@@ -157,17 +157,17 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
157
157
|
const contentValue = parse(content, parseErrors);
|
|
158
158
|
if (parseErrors.length > 0) {
|
|
159
159
|
return Promise.reject(( new Error(( localize(
|
|
160
|
-
|
|
160
|
+
12482,
|
|
161
161
|
"Problems parsing product icons file: {0}",
|
|
162
162
|
( parseErrors.map(e => getParseErrorMessage(e.error))).join(', ')
|
|
163
163
|
)))));
|
|
164
164
|
}
|
|
165
165
|
else if (getNodeType(contentValue) !== 'object') {
|
|
166
|
-
return Promise.reject(( new Error(( localize(
|
|
166
|
+
return Promise.reject(( new Error(( localize(12483, "Invalid format for product icons theme file: Object expected.")))));
|
|
167
167
|
}
|
|
168
168
|
else if (!contentValue.iconDefinitions || !Array.isArray(contentValue.fonts) || !contentValue.fonts.length) {
|
|
169
169
|
return Promise.reject(( new Error(( localize(
|
|
170
|
-
|
|
170
|
+
12484,
|
|
171
171
|
"Invalid format for product icons theme file: Must contain iconDefinitions and fonts."
|
|
172
172
|
)))));
|
|
173
173
|
}
|
|
@@ -181,14 +181,14 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
181
181
|
fontWeight = font.weight;
|
|
182
182
|
}
|
|
183
183
|
else {
|
|
184
|
-
warnings.push(( localize(
|
|
184
|
+
warnings.push(( localize(12485, 'Invalid font weight in font \'{0}\'. Ignoring setting.', font.id)));
|
|
185
185
|
}
|
|
186
186
|
let fontStyle = undefined;
|
|
187
187
|
if (isString(font.style) && font.style.match(fontStyleRegex)) {
|
|
188
188
|
fontStyle = font.style;
|
|
189
189
|
}
|
|
190
190
|
else {
|
|
191
|
-
warnings.push(( localize(
|
|
191
|
+
warnings.push(( localize(12486, 'Invalid font style in font \'{0}\'. Ignoring setting.', font.id)));
|
|
192
192
|
}
|
|
193
193
|
const sanitizedSrc = [];
|
|
194
194
|
if (Array.isArray(font.src)) {
|
|
@@ -198,7 +198,7 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
198
198
|
sanitizedSrc.push({ location: iconFontLocation, format: s.format });
|
|
199
199
|
}
|
|
200
200
|
else {
|
|
201
|
-
warnings.push(( localize(
|
|
201
|
+
warnings.push(( localize(12487, 'Invalid font source in font \'{0}\'. Ignoring source.', font.id)));
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
}
|
|
@@ -207,7 +207,7 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
207
207
|
}
|
|
208
208
|
else {
|
|
209
209
|
warnings.push(( localize(
|
|
210
|
-
|
|
210
|
+
12488,
|
|
211
211
|
'No valid font source in font \'{0}\'. Ignoring font definition.',
|
|
212
212
|
font.id
|
|
213
213
|
)));
|
|
@@ -215,7 +215,7 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
215
215
|
}
|
|
216
216
|
else {
|
|
217
217
|
warnings.push(( localize(
|
|
218
|
-
|
|
218
|
+
12489,
|
|
219
219
|
'Missing or invalid font id \'{0}\'. Skipping font definition.',
|
|
220
220
|
font.id
|
|
221
221
|
)));
|
|
@@ -233,11 +233,11 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
233
233
|
iconDefinitions.set(iconId, { fontCharacter: definition.fontCharacter, font });
|
|
234
234
|
}
|
|
235
235
|
else {
|
|
236
|
-
warnings.push(( localize(
|
|
236
|
+
warnings.push(( localize(12490, 'Skipping icon definition \'{0}\'. Unknown font.', iconId)));
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
else {
|
|
240
|
-
warnings.push(( localize(
|
|
240
|
+
warnings.push(( localize(12491, 'Skipping icon definition \'{0}\': Needs to be defined', iconId)));
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
return { iconDefinitions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
|
|
2
|
-
import { IWorkbenchColorTheme, IWorkbenchFileIconTheme, IWorkbenchProductIconTheme, ThemeSettingTarget
|
|
2
|
+
import { IWorkbenchColorTheme, IWorkbenchFileIconTheme, IWorkbenchProductIconTheme, ThemeSettingTarget } from "@codingame/monaco-vscode-9d0168a3-519b-57f3-9bcc-89efc41f951a-common/vscode/vs/workbench/services/themes/common/workbenchThemeService";
|
|
3
3
|
import { IWorkbenchThemeService } from "@codingame/monaco-vscode-7ba0af96-90c2-5e11-ad7f-befdbbf246c8-common/vscode/vs/workbench/services/themes/common/workbenchThemeService.service";
|
|
4
4
|
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
5
5
|
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
@@ -56,7 +56,7 @@ export declare class WorkbenchThemeService extends Disposable implements IWorkbe
|
|
|
56
56
|
getColorThemes(): Promise<IWorkbenchColorTheme[]>;
|
|
57
57
|
getPreferredColorScheme(): ColorScheme | undefined;
|
|
58
58
|
getMarketplaceColorThemes(publisher: string, name: string, version: string): Promise<IWorkbenchColorTheme[]>;
|
|
59
|
-
get onDidColorThemeChange(): Event<
|
|
59
|
+
get onDidColorThemeChange(): Event<IWorkbenchColorTheme>;
|
|
60
60
|
setColorTheme(themeIdOrTheme: string | undefined | IWorkbenchColorTheme, settingsTarget: ThemeSettingTarget): Promise<IWorkbenchColorTheme | null>;
|
|
61
61
|
private internalSetColorTheme;
|
|
62
62
|
private reloadCurrentColorTheme;
|
|
@@ -120,7 +120,7 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
120
120
|
this.onProductIconThemeChange = ( new Emitter());
|
|
121
121
|
this.currentProductIconTheme = ProductIconThemeData.createUnloadedTheme('');
|
|
122
122
|
this.productIconThemeSequencer = ( new Sequencer());
|
|
123
|
-
this._register(this.onDidColorThemeChange(
|
|
123
|
+
this._register(this.onDidColorThemeChange(theme => getColorRegistry().notifyThemeUpdate(theme)));
|
|
124
124
|
let themeData = ColorThemeData.fromStorageData(this.storageService);
|
|
125
125
|
const colorThemeSetting = this.settings.colorTheme;
|
|
126
126
|
if (themeData && colorThemeSetting !== themeData.settingsId) {
|
|
@@ -240,7 +240,7 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
240
240
|
}
|
|
241
241
|
if (hasColorChanges) {
|
|
242
242
|
this.updateDynamicCSSRules(this.currentColorTheme);
|
|
243
|
-
this.onColorThemeChange.fire(
|
|
243
|
+
this.onColorThemeChange.fire(this.currentColorTheme);
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
}));
|
|
@@ -322,7 +322,7 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
322
322
|
return this.settings.getPreferredColorScheme();
|
|
323
323
|
}
|
|
324
324
|
async getMarketplaceColorThemes(publisher, name, version) {
|
|
325
|
-
const extensionLocation = this.extensionResourceLoaderService.getExtensionGalleryResourceURL({ publisher, name, version }, 'extension');
|
|
325
|
+
const extensionLocation = await this.extensionResourceLoaderService.getExtensionGalleryResourceURL({ publisher, name, version }, 'extension');
|
|
326
326
|
if (extensionLocation) {
|
|
327
327
|
try {
|
|
328
328
|
const manifestContent = await this.extensionResourceLoaderService.readExtensionResource(joinPath(extensionLocation, 'package.json'));
|
|
@@ -369,7 +369,7 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
369
369
|
}
|
|
370
370
|
catch (error) {
|
|
371
371
|
throw ( new Error(( localize(
|
|
372
|
-
|
|
372
|
+
12492,
|
|
373
373
|
"Unable to load {0}: {1}",
|
|
374
374
|
themeData.location?.toString(),
|
|
375
375
|
error.message
|
|
@@ -447,7 +447,7 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
447
447
|
if (silent) {
|
|
448
448
|
return Promise.resolve(null);
|
|
449
449
|
}
|
|
450
|
-
this.onColorThemeChange.fire(
|
|
450
|
+
this.onColorThemeChange.fire(this.currentColorTheme);
|
|
451
451
|
if (newTheme.isLoaded && settingsTarget !== 'preview') {
|
|
452
452
|
newTheme.toStorage(this.storageService);
|
|
453
453
|
}
|
|
@@ -506,7 +506,7 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
506
506
|
return themeData;
|
|
507
507
|
}
|
|
508
508
|
async getMarketplaceFileIconThemes(publisher, name, version) {
|
|
509
|
-
const extensionLocation = this.extensionResourceLoaderService.getExtensionGalleryResourceURL({ publisher, name, version }, 'extension');
|
|
509
|
+
const extensionLocation = await this.extensionResourceLoaderService.getExtensionGalleryResourceURL({ publisher, name, version }, 'extension');
|
|
510
510
|
if (extensionLocation) {
|
|
511
511
|
try {
|
|
512
512
|
const manifestContent = await this.extensionResourceLoaderService.readExtensionResource(joinPath(extensionLocation, 'package.json'));
|
|
@@ -596,7 +596,7 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
596
596
|
return themeData;
|
|
597
597
|
}
|
|
598
598
|
async getMarketplaceProductIconThemes(publisher, name, version) {
|
|
599
|
-
const extensionLocation = this.extensionResourceLoaderService.getExtensionGalleryResourceURL({ publisher, name, version }, 'extension');
|
|
599
|
+
const extensionLocation = await this.extensionResourceLoaderService.getExtensionGalleryResourceURL({ publisher, name, version }, 'extension');
|
|
600
600
|
if (extensionLocation) {
|
|
601
601
|
try {
|
|
602
602
|
const manifestContent = await this.extensionResourceLoaderService.readExtensionResource(joinPath(extensionLocation, 'package.json'));
|
|
@@ -136,31 +136,31 @@ const textmateColorSchema = {
|
|
|
136
136
|
},
|
|
137
137
|
settings: {
|
|
138
138
|
type: 'object',
|
|
139
|
-
description: ( localize(
|
|
139
|
+
description: ( localize(12523, 'Colors and styles for the token.')),
|
|
140
140
|
properties: {
|
|
141
141
|
foreground: {
|
|
142
142
|
type: 'string',
|
|
143
|
-
description: ( localize(
|
|
143
|
+
description: ( localize(12524, 'Foreground color for the token.')),
|
|
144
144
|
format: 'color-hex',
|
|
145
145
|
default: '#ff0000'
|
|
146
146
|
},
|
|
147
147
|
background: {
|
|
148
148
|
type: 'string',
|
|
149
|
-
deprecationMessage: ( localize(
|
|
149
|
+
deprecationMessage: ( localize(12525, 'Token background colors are currently not supported.'))
|
|
150
150
|
},
|
|
151
151
|
fontStyle: {
|
|
152
152
|
type: 'string',
|
|
153
153
|
description: ( localize(
|
|
154
|
-
|
|
154
|
+
12526,
|
|
155
155
|
'Font style of the rule: \'italic\', \'bold\', \'underline\', \'strikethrough\' or a combination. The empty string unsets inherited settings.'
|
|
156
156
|
)),
|
|
157
157
|
pattern: '^(\\s*\\b(italic|bold|underline|strikethrough))*\\s*$',
|
|
158
158
|
patternErrorMessage: ( localize(
|
|
159
|
-
|
|
159
|
+
12527,
|
|
160
160
|
'Font style must be \'italic\', \'bold\', \'underline\', \'strikethrough\' or a combination or the empty string.'
|
|
161
161
|
)),
|
|
162
162
|
defaultSnippets: [
|
|
163
|
-
{ label: ( localize(
|
|
163
|
+
{ label: ( localize(12528, 'None (clear inherited style)')), bodyText: '""' },
|
|
164
164
|
{ body: 'italic' },
|
|
165
165
|
{ body: 'bold' },
|
|
166
166
|
{ body: 'underline' },
|
|
@@ -189,10 +189,10 @@ const textmateColorSchema = {
|
|
|
189
189
|
properties: {
|
|
190
190
|
name: {
|
|
191
191
|
type: 'string',
|
|
192
|
-
description: ( localize(
|
|
192
|
+
description: ( localize(12529, 'Description of the rule.'))
|
|
193
193
|
},
|
|
194
194
|
scope: {
|
|
195
|
-
description: ( localize(
|
|
195
|
+
description: ( localize(12530, 'Scope selector against which this rule matches.')),
|
|
196
196
|
anyOf: [
|
|
197
197
|
{
|
|
198
198
|
enum: textMateScopes
|
|
@@ -231,28 +231,28 @@ const colorThemeSchema = {
|
|
|
231
231
|
allowTrailingCommas: true,
|
|
232
232
|
properties: {
|
|
233
233
|
colors: {
|
|
234
|
-
description: ( localize(
|
|
234
|
+
description: ( localize(12531, 'Colors in the workbench')),
|
|
235
235
|
$ref: workbenchColorsSchemaId,
|
|
236
236
|
additionalProperties: false
|
|
237
237
|
},
|
|
238
238
|
tokenColors: {
|
|
239
239
|
anyOf: [{
|
|
240
240
|
type: 'string',
|
|
241
|
-
description: ( localize(
|
|
241
|
+
description: ( localize(12532, 'Path to a tmTheme file (relative to the current file).'))
|
|
242
242
|
},
|
|
243
243
|
{
|
|
244
|
-
description: ( localize(
|
|
244
|
+
description: ( localize(12533, 'Colors for syntax highlighting')),
|
|
245
245
|
$ref: textmateColorsSchemaId
|
|
246
246
|
}
|
|
247
247
|
]
|
|
248
248
|
},
|
|
249
249
|
semanticHighlighting: {
|
|
250
250
|
type: 'boolean',
|
|
251
|
-
description: ( localize(
|
|
251
|
+
description: ( localize(12534, 'Whether semantic highlighting should be enabled for this theme.'))
|
|
252
252
|
},
|
|
253
253
|
semanticTokenColors: {
|
|
254
254
|
type: 'object',
|
|
255
|
-
description: ( localize(
|
|
255
|
+
description: ( localize(12535, 'Colors for semantic tokens')),
|
|
256
256
|
$ref: tokenStylingSchemaId
|
|
257
257
|
}
|
|
258
258
|
}
|