@codingame/monaco-vscode-theme-service-override 31.0.1 → 32.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 +3 -3
- package/vscode/src/vs/workbench/contrib/themes/browser/themes.contribution.js +53 -47
- 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.js +8 -6
- package/vscode/src/vs/workbench/services/themes/common/colorThemeSchema.js +16 -16
- 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 +42 -37
- 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": "32.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": "
|
|
19
|
-
"@codingame/monaco-vscode-files-service-override": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "32.0.0",
|
|
19
|
+
"@codingame/monaco-vscode-files-service-override": "32.0.0"
|
|
20
20
|
},
|
|
21
21
|
"main": "index.js",
|
|
22
22
|
"module": "index.js",
|
|
@@ -50,9 +50,10 @@ import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/pla
|
|
|
50
50
|
import { mainWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/window';
|
|
51
51
|
import { IPreferencesService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/preferences/common/preferences.service';
|
|
52
52
|
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
53
|
+
import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
53
54
|
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
54
55
|
|
|
55
|
-
const manageExtensionIcon = registerIcon("theme-selection-manage-extension", Codicon.gear, ( localize(
|
|
56
|
+
const manageExtensionIcon = registerIcon("theme-selection-manage-extension", Codicon.gear, ( localize(15178, "Icon for the 'Manage' action in the theme selection quick pick.")));
|
|
56
57
|
var ConfigureItem;
|
|
57
58
|
(function(ConfigureItem) {
|
|
58
59
|
ConfigureItem["BROWSE_GALLERY"] = "marketplace";
|
|
@@ -69,7 +70,8 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
69
70
|
logService,
|
|
70
71
|
progressService,
|
|
71
72
|
extensionsWorkbenchService,
|
|
72
|
-
dialogService
|
|
73
|
+
dialogService,
|
|
74
|
+
environmentService
|
|
73
75
|
) {
|
|
74
76
|
this.getMarketplaceColorThemes = getMarketplaceColorThemes;
|
|
75
77
|
this.marketplaceQuery = marketplaceQuery;
|
|
@@ -80,6 +82,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
80
82
|
this.progressService = progressService;
|
|
81
83
|
this.extensionsWorkbenchService = extensionsWorkbenchService;
|
|
82
84
|
this.dialogService = dialogService;
|
|
85
|
+
this.environmentService = environmentService;
|
|
83
86
|
this._marketplaceExtensions = ( new Set());
|
|
84
87
|
this._marketplaceThemes = [];
|
|
85
88
|
this._searchOngoing = false;
|
|
@@ -133,6 +136,9 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
133
136
|
break;
|
|
134
137
|
}
|
|
135
138
|
const ext = gallery[i];
|
|
139
|
+
if (this.environmentService.isSessionsWindow && ext.properties.executesCode) {
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
136
142
|
if (!( installedExtensions.has(ext.identifier.id)) && !( this._marketplaceExtensions.has(ext.identifier.id))) {
|
|
137
143
|
this._marketplaceExtensions.add(ext.identifier.id);
|
|
138
144
|
promises.push(this.getMarketplaceColorThemes(ext.publisher, ext.name, ext.version));
|
|
@@ -178,7 +184,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
178
184
|
quickpick.matchOnDescription = true;
|
|
179
185
|
quickpick.buttons = [this.quickInputService.backButton];
|
|
180
186
|
quickpick.title = "Marketplace Themes";
|
|
181
|
-
quickpick.placeholder = ( localize(
|
|
187
|
+
quickpick.placeholder = ( localize(15179, "Type to Search More. Select to Install. Up/Down Keys to Preview"));
|
|
182
188
|
quickpick.canSelectMany = false;
|
|
183
189
|
disposables.add(quickpick.onDidChangeValue(() => this.trigger(quickpick.value)));
|
|
184
190
|
disposables.add(quickpick.onDidAccept(async _ => {
|
|
@@ -232,7 +238,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
232
238
|
});
|
|
233
239
|
} else if (items.length === 0 && this._searchError) {
|
|
234
240
|
items = [{
|
|
235
|
-
label: `$(error) ${( localize(
|
|
241
|
+
label: `$(error) ${( localize(15180, "Error while searching for themes: {0}", this._searchError))}`,
|
|
236
242
|
id: undefined,
|
|
237
243
|
alwaysShow: true
|
|
238
244
|
}];
|
|
@@ -254,12 +260,12 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
254
260
|
this.extensionsWorkbenchService.openSearch(`@id:${galleryExtension.identifier.id}`);
|
|
255
261
|
const result = await this.dialogService.confirm({
|
|
256
262
|
message: ( localize(
|
|
257
|
-
|
|
263
|
+
15181,
|
|
258
264
|
"This will install extension '{0}' published by '{1}'. Do you want to continue?",
|
|
259
265
|
galleryExtension.displayName,
|
|
260
266
|
galleryExtension.publisherDisplayName
|
|
261
267
|
)),
|
|
262
|
-
primaryButton: ( localize(
|
|
268
|
+
primaryButton: ( localize(15182, "OK"))
|
|
263
269
|
});
|
|
264
270
|
if (!result.confirmed) {
|
|
265
271
|
return false;
|
|
@@ -267,7 +273,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
267
273
|
try {
|
|
268
274
|
await this.progressService.withProgress({
|
|
269
275
|
location: ProgressLocation.Notification,
|
|
270
|
-
title: ( localize(
|
|
276
|
+
title: ( localize(15183, "Installing Extension {0}...", galleryExtension.displayName))
|
|
271
277
|
}, async () => {
|
|
272
278
|
await this.extensionManagementService.installFromGallery(galleryExtension, {
|
|
273
279
|
isMachineScoped: false
|
|
@@ -290,7 +296,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
290
296
|
this._onDidChange.dispose();
|
|
291
297
|
}
|
|
292
298
|
};
|
|
293
|
-
MarketplaceThemesPicker = ( __decorate([( __param(2, IExtensionGalleryService)), ( __param(3, IExtensionManagementService)), ( __param(4, IQuickInputService)), ( __param(5, ILogService)), ( __param(6, IProgressService)), ( __param(7, IExtensionsWorkbenchService)), ( __param(8, IDialogService))], MarketplaceThemesPicker));
|
|
299
|
+
MarketplaceThemesPicker = ( __decorate([( __param(2, IExtensionGalleryService)), ( __param(3, IExtensionManagementService)), ( __param(4, IQuickInputService)), ( __param(5, ILogService)), ( __param(6, IProgressService)), ( __param(7, IExtensionsWorkbenchService)), ( __param(8, IDialogService)), ( __param(9, IWorkbenchEnvironmentService))], MarketplaceThemesPicker));
|
|
294
300
|
let InstalledThemesPicker = class InstalledThemesPicker {
|
|
295
301
|
constructor(
|
|
296
302
|
options,
|
|
@@ -418,7 +424,7 @@ registerAction2(class extends Action2 {
|
|
|
418
424
|
constructor() {
|
|
419
425
|
super({
|
|
420
426
|
id: SelectColorThemeCommandId,
|
|
421
|
-
title: ( localize2(
|
|
427
|
+
title: ( localize2(15184, "Color Theme")),
|
|
422
428
|
category: Categories.Preferences,
|
|
423
429
|
f1: true,
|
|
424
430
|
keybinding: {
|
|
@@ -430,15 +436,15 @@ registerAction2(class extends Action2 {
|
|
|
430
436
|
getTitle(colorScheme) {
|
|
431
437
|
switch (colorScheme) {
|
|
432
438
|
case ColorScheme.DARK:
|
|
433
|
-
return localize(
|
|
439
|
+
return localize(15185, "Select Color Theme for System Dark Mode");
|
|
434
440
|
case ColorScheme.LIGHT:
|
|
435
|
-
return localize(
|
|
441
|
+
return localize(15186, "Select Color Theme for System Light Mode");
|
|
436
442
|
case ColorScheme.HIGH_CONTRAST_DARK:
|
|
437
|
-
return localize(
|
|
443
|
+
return localize(15187, "Select Color Theme for High Contrast Dark Mode");
|
|
438
444
|
case ColorScheme.HIGH_CONTRAST_LIGHT:
|
|
439
|
-
return localize(
|
|
445
|
+
return localize(15188, "Select Color Theme for High Contrast Light Mode");
|
|
440
446
|
default:
|
|
441
|
-
return localize(
|
|
447
|
+
return localize(15189, "Select Color Theme (detect system color mode disabled)");
|
|
442
448
|
}
|
|
443
449
|
}
|
|
444
450
|
async run(accessor) {
|
|
@@ -446,13 +452,13 @@ registerAction2(class extends Action2 {
|
|
|
446
452
|
const preferencesService = accessor.get(IPreferencesService);
|
|
447
453
|
const preferredColorScheme = themeService.getPreferredColorScheme();
|
|
448
454
|
const modeConfigureButton = {
|
|
449
|
-
tooltip: preferredColorScheme ? ( localize(
|
|
455
|
+
tooltip: preferredColorScheme ? ( localize(15190, "Detect system color mode enabled. Click to configure.")) : ( localize(15191, "Detect system color mode disabled. Click to configure.")),
|
|
450
456
|
iconClass: ThemeIcon.asClassName(Codicon.colorMode),
|
|
451
457
|
location: QuickInputButtonLocation.Inline
|
|
452
458
|
};
|
|
453
459
|
const options = {
|
|
454
|
-
installMessage: ( localize(
|
|
455
|
-
browseMessage: "$(plus) " + ( localize(
|
|
460
|
+
installMessage: ( localize(15192, "Install Additional Color Themes...")),
|
|
461
|
+
browseMessage: "$(plus) " + ( localize(15193, "Browse Additional Color Themes...")),
|
|
456
462
|
placeholderMessage: this.getTitle(preferredColorScheme),
|
|
457
463
|
marketplaceTag: "category:themes",
|
|
458
464
|
buttons: [modeConfigureButton],
|
|
@@ -469,9 +475,9 @@ registerAction2(class extends Action2 {
|
|
|
469
475
|
const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
|
|
470
476
|
const themes = await themeService.getColorThemes();
|
|
471
477
|
const currentTheme = themeService.getColorTheme();
|
|
472
|
-
const lightEntries = toEntries(themes.filter(t => t.type === ColorScheme.LIGHT), ( localize(
|
|
473
|
-
const darkEntries = toEntries(themes.filter(t => t.type === ColorScheme.DARK), ( localize(
|
|
474
|
-
const hcEntries = toEntries(themes.filter(t => isHighContrast(t.type)), ( localize(
|
|
478
|
+
const lightEntries = toEntries(themes.filter(t => t.type === ColorScheme.LIGHT), ( localize(15194, "light themes")));
|
|
479
|
+
const darkEntries = toEntries(themes.filter(t => t.type === ColorScheme.DARK), ( localize(15195, "dark themes")));
|
|
480
|
+
const hcEntries = toEntries(themes.filter(t => isHighContrast(t.type)), ( localize(15196, "high contrast themes")));
|
|
475
481
|
let picks;
|
|
476
482
|
switch (preferredColorScheme) {
|
|
477
483
|
case ColorScheme.DARK:
|
|
@@ -494,7 +500,7 @@ registerAction2(class extends Action2 {
|
|
|
494
500
|
constructor() {
|
|
495
501
|
super({
|
|
496
502
|
id: SelectFileIconThemeCommandId,
|
|
497
|
-
title: ( localize2(
|
|
503
|
+
title: ( localize2(15197, "File Icon Theme")),
|
|
498
504
|
category: Categories.Preferences,
|
|
499
505
|
f1: true
|
|
500
506
|
});
|
|
@@ -502,8 +508,8 @@ registerAction2(class extends Action2 {
|
|
|
502
508
|
async run(accessor) {
|
|
503
509
|
const themeService = accessor.get(IWorkbenchThemeService);
|
|
504
510
|
const options = {
|
|
505
|
-
installMessage: ( localize(
|
|
506
|
-
placeholderMessage: ( localize(
|
|
511
|
+
installMessage: ( localize(15198, "Install Additional File Icon Themes...")),
|
|
512
|
+
placeholderMessage: ( localize(15199, "Select File Icon Theme (Up/Down Keys to Preview)")),
|
|
507
513
|
marketplaceTag: "tag:icon-theme"
|
|
508
514
|
};
|
|
509
515
|
const setTheme = (theme, settingsTarget) => themeService.setFileIconTheme(theme, settingsTarget);
|
|
@@ -512,12 +518,12 @@ registerAction2(class extends Action2 {
|
|
|
512
518
|
const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
|
|
513
519
|
const picks = [{
|
|
514
520
|
type: "separator",
|
|
515
|
-
label: ( localize(
|
|
521
|
+
label: ( localize(15200, "file icon themes"))
|
|
516
522
|
}, {
|
|
517
523
|
id: "",
|
|
518
524
|
theme: FileIconThemeData.noIconTheme,
|
|
519
|
-
label: ( localize(
|
|
520
|
-
description: ( localize(
|
|
525
|
+
label: ( localize(15201, "None")),
|
|
526
|
+
description: ( localize(15202, "Disable File Icons"))
|
|
521
527
|
}, ...toEntries(await themeService.getFileIconThemes())];
|
|
522
528
|
await picker.openQuickPick(picks, themeService.getFileIconTheme());
|
|
523
529
|
}
|
|
@@ -527,7 +533,7 @@ registerAction2(class extends Action2 {
|
|
|
527
533
|
constructor() {
|
|
528
534
|
super({
|
|
529
535
|
id: SelectProductIconThemeCommandId,
|
|
530
|
-
title: ( localize2(
|
|
536
|
+
title: ( localize2(15203, "Product Icon Theme")),
|
|
531
537
|
category: Categories.Preferences,
|
|
532
538
|
f1: true
|
|
533
539
|
});
|
|
@@ -535,9 +541,9 @@ registerAction2(class extends Action2 {
|
|
|
535
541
|
async run(accessor) {
|
|
536
542
|
const themeService = accessor.get(IWorkbenchThemeService);
|
|
537
543
|
const options = {
|
|
538
|
-
installMessage: ( localize(
|
|
539
|
-
browseMessage: "$(plus) " + ( localize(
|
|
540
|
-
placeholderMessage: ( localize(
|
|
544
|
+
installMessage: ( localize(15204, "Install Additional Product Icon Themes...")),
|
|
545
|
+
browseMessage: "$(plus) " + ( localize(15205, "Browse Additional Product Icon Themes...")),
|
|
546
|
+
placeholderMessage: ( localize(15206, "Select Product Icon Theme (Up/Down Keys to Preview)")),
|
|
541
547
|
marketplaceTag: "tag:product-icon-theme"
|
|
542
548
|
};
|
|
543
549
|
const setTheme = (theme, settingsTarget) => themeService.setProductIconTheme(theme, settingsTarget);
|
|
@@ -546,11 +552,11 @@ registerAction2(class extends Action2 {
|
|
|
546
552
|
const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
|
|
547
553
|
const picks = [{
|
|
548
554
|
type: "separator",
|
|
549
|
-
label: ( localize(
|
|
555
|
+
label: ( localize(15207, "product icon themes"))
|
|
550
556
|
}, {
|
|
551
557
|
id: DEFAULT_PRODUCT_ICON_THEME_ID,
|
|
552
558
|
theme: ProductIconThemeData.defaultTheme,
|
|
553
|
-
label: ( localize(
|
|
559
|
+
label: ( localize(15208, "Default"))
|
|
554
560
|
}, ...toEntries(await themeService.getProductIconThemes())];
|
|
555
561
|
await picker.openQuickPick(picks, themeService.getProductIconTheme());
|
|
556
562
|
}
|
|
@@ -559,7 +565,7 @@ registerAction2(class extends Action2 {
|
|
|
559
565
|
constructor() {
|
|
560
566
|
super({
|
|
561
567
|
id: "workbench.action.tryNewDefaultThemes",
|
|
562
|
-
title: ( localize2(
|
|
568
|
+
title: ( localize2(15209, "Try New Default Themes")),
|
|
563
569
|
category: Categories.Preferences,
|
|
564
570
|
f1: true
|
|
565
571
|
});
|
|
@@ -583,7 +589,7 @@ registerAction2(class extends Action2 {
|
|
|
583
589
|
const disposables = ( new DisposableStore());
|
|
584
590
|
const picker = disposables.add(quickInputService.createQuickPick());
|
|
585
591
|
picker.items = items;
|
|
586
|
-
picker.placeholder = ( localize(
|
|
592
|
+
picker.placeholder = ( localize(15210, "Pick a new default theme"));
|
|
587
593
|
picker.canSelectMany = false;
|
|
588
594
|
const preferredId = (previousTheme.type === ColorScheme.LIGHT || previousTheme.type === ColorScheme.HIGH_CONTRAST_LIGHT) ? ThemeSettingDefaults.COLOR_THEME_LIGHT : ThemeSettingDefaults.COLOR_THEME_DARK;
|
|
589
595
|
const activeItem = items.find(i => themes.find(t => t.id === i.id)?.settingsId === preferredId);
|
|
@@ -669,8 +675,8 @@ function isItem(i) {
|
|
|
669
675
|
return i["type"] !== "separator";
|
|
670
676
|
}
|
|
671
677
|
const defaultThemeDescriptions = {
|
|
672
|
-
[ThemeSettingDefaults.COLOR_THEME_LIGHT]: ( localize(
|
|
673
|
-
[ThemeSettingDefaults.COLOR_THEME_DARK]: ( localize(
|
|
678
|
+
[ThemeSettingDefaults.COLOR_THEME_LIGHT]: ( localize(15211, "Default Light")),
|
|
679
|
+
[ThemeSettingDefaults.COLOR_THEME_DARK]: ( localize(15212, "Default Dark"))
|
|
674
680
|
};
|
|
675
681
|
function toEntry(theme) {
|
|
676
682
|
const settingId = theme.settingsId ?? undefined;
|
|
@@ -709,13 +715,13 @@ function toEntries(themes, label) {
|
|
|
709
715
|
}
|
|
710
716
|
const configureButton = {
|
|
711
717
|
iconClass: ThemeIcon.asClassName(manageExtensionIcon),
|
|
712
|
-
tooltip: ( localize(
|
|
718
|
+
tooltip: ( localize(15213, "Manage Extension"))
|
|
713
719
|
};
|
|
714
720
|
registerAction2(class extends Action2 {
|
|
715
721
|
constructor() {
|
|
716
722
|
super({
|
|
717
723
|
id: "workbench.action.generateColorTheme",
|
|
718
|
-
title: ( localize2(
|
|
724
|
+
title: ( localize2(15214, "Generate Color Theme From Current Settings")),
|
|
719
725
|
category: Categories.Developer,
|
|
720
726
|
f1: true
|
|
721
727
|
});
|
|
@@ -770,7 +776,7 @@ registerAction2(class extends Action2 {
|
|
|
770
776
|
constructor() {
|
|
771
777
|
super({
|
|
772
778
|
id: toggleLightDarkThemesCommandId,
|
|
773
|
-
title: ( localize2(
|
|
779
|
+
title: ( localize2(15215, "Toggle between Light/Dark Themes")),
|
|
774
780
|
category: Categories.Preferences,
|
|
775
781
|
f1: true
|
|
776
782
|
});
|
|
@@ -782,12 +788,12 @@ registerAction2(class extends Action2 {
|
|
|
782
788
|
const preferencesService = accessor.get(IPreferencesService);
|
|
783
789
|
if (configurationService.getValue(ThemeSettings.DETECT_COLOR_SCHEME)) {
|
|
784
790
|
const message = ( localize(
|
|
785
|
-
|
|
791
|
+
15216,
|
|
786
792
|
"Cannot toggle between light and dark themes when `{0}` is enabled in settings.",
|
|
787
793
|
ThemeSettings.DETECT_COLOR_SCHEME
|
|
788
794
|
));
|
|
789
795
|
notificationService.prompt(Severity.Info, message, [{
|
|
790
|
-
label: ( localize(
|
|
796
|
+
label: ( localize(15217, "Open Settings")),
|
|
791
797
|
run: () => {
|
|
792
798
|
return preferencesService.openUserSettings({
|
|
793
799
|
query: ThemeSettings.DETECT_COLOR_SCHEME
|
|
@@ -826,7 +832,7 @@ registerAction2(class extends Action2 {
|
|
|
826
832
|
constructor() {
|
|
827
833
|
super({
|
|
828
834
|
id: browseColorThemesInMarketplaceCommandId,
|
|
829
|
-
title: ( localize2(
|
|
835
|
+
title: ( localize2(15218, "Browse Color Themes in Marketplace")),
|
|
830
836
|
category: Categories.Preferences,
|
|
831
837
|
f1: true
|
|
832
838
|
});
|
|
@@ -867,13 +873,13 @@ registerAction2(class extends Action2 {
|
|
|
867
873
|
});
|
|
868
874
|
const ThemesSubMenu = ( new MenuId("ThemesSubMenu"));
|
|
869
875
|
MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
|
|
870
|
-
title: ( localize(
|
|
876
|
+
title: ( localize(15219, "Themes")),
|
|
871
877
|
submenu: ThemesSubMenu,
|
|
872
878
|
group: "2_configuration",
|
|
873
879
|
order: 7
|
|
874
880
|
});
|
|
875
881
|
MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
|
|
876
|
-
title: ( localize(
|
|
882
|
+
title: ( localize(15220, "&&Themes")),
|
|
877
883
|
submenu: ThemesSubMenu,
|
|
878
884
|
group: "2_configuration",
|
|
879
885
|
order: 7
|
|
@@ -881,21 +887,21 @@ MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
|
|
|
881
887
|
MenuRegistry.appendMenuItem(ThemesSubMenu, {
|
|
882
888
|
command: {
|
|
883
889
|
id: SelectColorThemeCommandId,
|
|
884
|
-
title: ( localize(
|
|
890
|
+
title: ( localize(15184, "Color Theme"))
|
|
885
891
|
},
|
|
886
892
|
order: 1
|
|
887
893
|
});
|
|
888
894
|
MenuRegistry.appendMenuItem(ThemesSubMenu, {
|
|
889
895
|
command: {
|
|
890
896
|
id: SelectFileIconThemeCommandId,
|
|
891
|
-
title: ( localize(
|
|
897
|
+
title: ( localize(15221, "File Icon Theme"))
|
|
892
898
|
},
|
|
893
899
|
order: 2
|
|
894
900
|
});
|
|
895
901
|
MenuRegistry.appendMenuItem(ThemesSubMenu, {
|
|
896
902
|
command: {
|
|
897
903
|
id: SelectProductIconThemeCommandId,
|
|
898
|
-
title: ( localize(
|
|
904
|
+
title: ( localize(15222, "Product Icon Theme"))
|
|
899
905
|
},
|
|
900
906
|
order: 3
|
|
901
907
|
});
|
|
@@ -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
|
-
|
|
152
|
+
16937,
|
|
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(
|
|
157
|
+
return Promise.reject(( new Error(( localize(16938, "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
|
-
|
|
46
|
+
16939,
|
|
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(
|
|
79
|
+
themeData = ProductIconThemeData._defaultProductIconTheme = ( new ProductIconThemeData(DEFAULT_PRODUCT_ICON_THEME_ID, ( localize(16940, "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
|
-
|
|
190
|
+
16941,
|
|
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(
|
|
195
|
+
return Promise.reject(( new Error(( localize(16942, "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
|
-
|
|
198
|
+
16943,
|
|
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(
|
|
211
|
+
warnings.push(( localize(16944, "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(
|
|
217
|
+
warnings.push(( localize(16945, "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(
|
|
229
|
+
warnings.push(( localize(16946, "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
|
-
|
|
241
|
+
16947,
|
|
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
|
-
|
|
248
|
+
16948,
|
|
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(
|
|
271
|
+
warnings.push(( localize(16949, "Skipping icon definition '{0}'. Unknown font.", iconId)));
|
|
272
272
|
}
|
|
273
273
|
} else {
|
|
274
|
-
warnings.push(( localize(
|
|
274
|
+
warnings.push(( localize(16950, "Skipping icon definition '{0}': Needs to be defined", iconId)));
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
return {
|
|
@@ -121,7 +121,8 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
121
121
|
this.colorThemeRegistry = this._register(( new ThemeRegistry(colorThemesExtPoint, ColorThemeData.fromExtensionTheme)));
|
|
122
122
|
this.colorThemeWatcher = this._register(( new ThemeFileWatcher(fileService, environmentService, this.reloadCurrentColorTheme.bind(this))));
|
|
123
123
|
this.onColorThemeChange = this._register(( new Emitter({
|
|
124
|
-
leakWarningThreshold: 400
|
|
124
|
+
leakWarningThreshold: 400,
|
|
125
|
+
leakWarningName: "ThemeService.onColorThemeChange"
|
|
125
126
|
})));
|
|
126
127
|
this.currentColorTheme = ColorThemeData.createUnloadedTheme("");
|
|
127
128
|
this.colorThemeSequencer = ( new Sequencer());
|
|
@@ -138,7 +139,8 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
138
139
|
)));
|
|
139
140
|
this.fileIconThemeLoader = ( new FileIconThemeLoader(extensionResourceLoaderService, languageService));
|
|
140
141
|
this.onFileIconThemeChange = this._register(( new Emitter({
|
|
141
|
-
leakWarningThreshold: 400
|
|
142
|
+
leakWarningThreshold: 400,
|
|
143
|
+
leakWarningName: "ThemeService.onFileIconThemeChange"
|
|
142
144
|
})));
|
|
143
145
|
this.currentFileIconTheme = FileIconThemeData.createUnloadedTheme("");
|
|
144
146
|
this.fileIconThemeSequencer = ( new Sequencer());
|
|
@@ -289,16 +291,16 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
289
291
|
}
|
|
290
292
|
const keepTheme = await ( new Promise(resolve => {
|
|
291
293
|
this.notificationService.prompt(Severity.Info, ( localize(
|
|
292
|
-
|
|
294
|
+
16951,
|
|
293
295
|
"VS Code has a new default theme: '{0}'.",
|
|
294
296
|
this.getColorTheme().label
|
|
295
297
|
)), [toAction({
|
|
296
298
|
id: "themeUpdated.tryItOut",
|
|
297
|
-
label: ( localize(
|
|
299
|
+
label: ( localize(16952, "Keep It")),
|
|
298
300
|
run: () => resolve(true)
|
|
299
301
|
}), toAction({
|
|
300
302
|
id: "themeUpdated.noThanks",
|
|
301
|
-
label: ( localize(
|
|
303
|
+
label: ( localize(16953, "No Thanks")),
|
|
302
304
|
run: () => resolve(false)
|
|
303
305
|
})], {
|
|
304
306
|
onCancel: () => resolve(false)
|
|
@@ -494,7 +496,7 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
494
496
|
return this.applyTheme(themeData, settingsTarget);
|
|
495
497
|
} catch (error) {
|
|
496
498
|
throw ( new Error(( localize(
|
|
497
|
-
|
|
499
|
+
16954,
|
|
498
500
|
"Unable to load {0}: {1}",
|
|
499
501
|
themeData.location?.toString(),
|
|
500
502
|
error.message
|
|
@@ -133,31 +133,31 @@ const textmateColorSchema = {
|
|
|
133
133
|
},
|
|
134
134
|
settings: {
|
|
135
135
|
type: "object",
|
|
136
|
-
description: ( localize(
|
|
136
|
+
description: ( localize(16985, "Colors and styles for the token.")),
|
|
137
137
|
properties: {
|
|
138
138
|
foreground: {
|
|
139
139
|
type: "string",
|
|
140
|
-
description: ( localize(
|
|
140
|
+
description: ( localize(16986, "Foreground color for the token.")),
|
|
141
141
|
format: "color-hex",
|
|
142
142
|
default: "#ff0000"
|
|
143
143
|
},
|
|
144
144
|
background: {
|
|
145
145
|
type: "string",
|
|
146
|
-
deprecationMessage: ( localize(
|
|
146
|
+
deprecationMessage: ( localize(16987, "Token background colors are currently not supported."))
|
|
147
147
|
},
|
|
148
148
|
fontStyle: {
|
|
149
149
|
type: "string",
|
|
150
150
|
description: ( localize(
|
|
151
|
-
|
|
151
|
+
16988,
|
|
152
152
|
"Font style of the rule: 'italic', 'bold', 'underline', 'strikethrough' or a combination. The empty string unsets inherited settings."
|
|
153
153
|
)),
|
|
154
154
|
pattern: "^(\\s*\\b(italic|bold|underline|strikethrough))*\\s*$",
|
|
155
155
|
patternErrorMessage: ( localize(
|
|
156
|
-
|
|
156
|
+
16989,
|
|
157
157
|
"Font style must be 'italic', 'bold', 'underline', 'strikethrough' or a combination or the empty string."
|
|
158
158
|
)),
|
|
159
159
|
defaultSnippets: [{
|
|
160
|
-
label: ( localize(
|
|
160
|
+
label: ( localize(16990, "None (clear inherited style)")),
|
|
161
161
|
bodyText: "\"\""
|
|
162
162
|
}, {
|
|
163
163
|
body: "italic"
|
|
@@ -194,21 +194,21 @@ const textmateColorSchema = {
|
|
|
194
194
|
fontFamily: {
|
|
195
195
|
type: "string",
|
|
196
196
|
description: ( localize(
|
|
197
|
-
|
|
197
|
+
16991,
|
|
198
198
|
"Font family for the token (e.g., \"Fira Code\", \"JetBrains Mono\")."
|
|
199
199
|
))
|
|
200
200
|
},
|
|
201
201
|
fontSize: {
|
|
202
202
|
type: "number",
|
|
203
203
|
description: ( localize(
|
|
204
|
-
|
|
204
|
+
16992,
|
|
205
205
|
"Font size multiplier for the token (e.g., 1.2 will use 1.2 times the default font size)."
|
|
206
206
|
))
|
|
207
207
|
},
|
|
208
208
|
lineHeight: {
|
|
209
209
|
type: "number",
|
|
210
210
|
description: ( localize(
|
|
211
|
-
|
|
211
|
+
16993,
|
|
212
212
|
"Line height multiplier for the token (e.g., 1.2 will use 1.2 times the default height). If the font size is set and the line height is not explicitly set, the line height will be computed based on the font size."
|
|
213
213
|
))
|
|
214
214
|
}
|
|
@@ -235,10 +235,10 @@ const textmateColorSchema = {
|
|
|
235
235
|
properties: {
|
|
236
236
|
name: {
|
|
237
237
|
type: "string",
|
|
238
|
-
description: ( localize(
|
|
238
|
+
description: ( localize(16994, "Description of the rule."))
|
|
239
239
|
},
|
|
240
240
|
scope: {
|
|
241
|
-
description: ( localize(
|
|
241
|
+
description: ( localize(16995, "Scope selector against which this rule matches.")),
|
|
242
242
|
anyOf: [{
|
|
243
243
|
enum: textMateScopes
|
|
244
244
|
}, {
|
|
@@ -270,26 +270,26 @@ const colorThemeSchema = {
|
|
|
270
270
|
allowTrailingCommas: true,
|
|
271
271
|
properties: {
|
|
272
272
|
colors: {
|
|
273
|
-
description: ( localize(
|
|
273
|
+
description: ( localize(16996, "Colors in the workbench")),
|
|
274
274
|
$ref: workbenchColorsSchemaId,
|
|
275
275
|
additionalProperties: false
|
|
276
276
|
},
|
|
277
277
|
tokenColors: {
|
|
278
278
|
anyOf: [{
|
|
279
279
|
type: "string",
|
|
280
|
-
description: ( localize(
|
|
280
|
+
description: ( localize(16997, "Path to a tmTheme file (relative to the current file)."))
|
|
281
281
|
}, {
|
|
282
|
-
description: ( localize(
|
|
282
|
+
description: ( localize(16998, "Colors for syntax highlighting")),
|
|
283
283
|
$ref: textmateColorsSchemaId
|
|
284
284
|
}]
|
|
285
285
|
},
|
|
286
286
|
semanticHighlighting: {
|
|
287
287
|
type: "boolean",
|
|
288
|
-
description: ( localize(
|
|
288
|
+
description: ( localize(16999, "Whether semantic highlighting should be enabled for this theme."))
|
|
289
289
|
},
|
|
290
290
|
semanticTokenColors: {
|
|
291
291
|
type: "object",
|
|
292
|
-
description: ( localize(
|
|
292
|
+
description: ( localize(17000, "Colors for semantic tokens")),
|
|
293
293
|
$ref: tokenStylingSchemaId
|
|
294
294
|
}
|
|
295
295
|
}
|