@codingame/monaco-vscode-theme-service-override 16.1.0 → 17.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 +6 -6
- package/vscode/src/vs/workbench/contrib/themes/browser/themes.contribution.js +43 -42
- 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 +10 -9
- package/vscode/src/vs/workbench/services/themes/common/colorThemeSchema.js +14 -14
- 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 +37 -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": "17.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-
|
|
19
|
-
"@codingame/monaco-vscode-
|
|
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-34a0ffd3-b9f5-5699-b43b-38af5732f38a-common": "17.0.0",
|
|
19
|
+
"@codingame/monaco-vscode-7443a901-21f6-577a-9674-42893b997ee0-common": "17.0.0",
|
|
20
|
+
"@codingame/monaco-vscode-9d0168a3-519b-57f3-9bcc-89efc41f951a-common": "17.0.0",
|
|
21
|
+
"@codingame/monaco-vscode-api": "17.0.0",
|
|
22
|
+
"@codingame/monaco-vscode-files-service-override": "17.0.0"
|
|
23
23
|
},
|
|
24
24
|
"main": "index.js",
|
|
25
25
|
"module": "index.js",
|
|
@@ -7,7 +7,7 @@ import { equalsIgnoreCase } from '@codingame/monaco-vscode-api/vscode/vs/base/co
|
|
|
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
9
|
import { ThemeSettings } from '@codingame/monaco-vscode-9d0168a3-519b-57f3-9bcc-89efc41f951a-common/vscode/vs/workbench/services/themes/common/workbenchThemeService';
|
|
10
|
-
import { IWorkbenchThemeService } from '@codingame/monaco-vscode-
|
|
10
|
+
import { IWorkbenchThemeService } from '@codingame/monaco-vscode-7443a901-21f6-577a-9674-42893b997ee0-common/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';
|
|
13
13
|
import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colorUtils';
|
|
@@ -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(11092, '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(11093, "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(11094, '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
|
+
11095,
|
|
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(11096, "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(11097, "Installing Extension {0}...", galleryExtension.displayName))
|
|
249
249
|
}, async () => {
|
|
250
250
|
await this.extensionManagementService.installFromGallery(galleryExtension, {
|
|
251
251
|
isMachineScoped: false,
|
|
@@ -266,6 +266,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
266
266
|
this._queryDelayer.dispose();
|
|
267
267
|
this._marketplaceExtensions.clear();
|
|
268
268
|
this._marketplaceThemes.length = 0;
|
|
269
|
+
this._onDidChange.dispose();
|
|
269
270
|
}
|
|
270
271
|
};
|
|
271
272
|
MarketplaceThemesPicker = ( __decorate([
|
|
@@ -392,7 +393,7 @@ registerAction2(class extends Action2 {
|
|
|
392
393
|
constructor() {
|
|
393
394
|
super({
|
|
394
395
|
id: SelectColorThemeCommandId,
|
|
395
|
-
title: ( localize2(
|
|
396
|
+
title: ( localize2(11098, 'Color Theme')),
|
|
396
397
|
category: Categories.Preferences,
|
|
397
398
|
f1: true,
|
|
398
399
|
keybinding: {
|
|
@@ -403,12 +404,12 @@ registerAction2(class extends Action2 {
|
|
|
403
404
|
}
|
|
404
405
|
getTitle(colorScheme) {
|
|
405
406
|
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(
|
|
407
|
+
case ColorScheme.DARK: return localize(11099, "Select Color Theme for System Dark Mode");
|
|
408
|
+
case ColorScheme.LIGHT: return localize(11100, "Select Color Theme for System Light Mode");
|
|
409
|
+
case ColorScheme.HIGH_CONTRAST_DARK: return localize(11101, "Select Color Theme for High Contrast Dark Mode");
|
|
410
|
+
case ColorScheme.HIGH_CONTRAST_LIGHT: return localize(11102, "Select Color Theme for High Contrast Light Mode");
|
|
410
411
|
default:
|
|
411
|
-
return localize(
|
|
412
|
+
return localize(11103, "Select Color Theme (detect system color mode disabled)");
|
|
412
413
|
}
|
|
413
414
|
}
|
|
414
415
|
async run(accessor) {
|
|
@@ -418,7 +419,7 @@ registerAction2(class extends Action2 {
|
|
|
418
419
|
let modeConfigureToggle;
|
|
419
420
|
if (preferredColorScheme) {
|
|
420
421
|
modeConfigureToggle = ( new Toggle({
|
|
421
|
-
title: ( localize(
|
|
422
|
+
title: ( localize(11104, 'Detect system color mode enabled. Click to configure.')),
|
|
422
423
|
icon: Codicon.colorMode,
|
|
423
424
|
isChecked: false,
|
|
424
425
|
...defaultToggleStyles
|
|
@@ -426,15 +427,15 @@ registerAction2(class extends Action2 {
|
|
|
426
427
|
}
|
|
427
428
|
else {
|
|
428
429
|
modeConfigureToggle = ( new Toggle({
|
|
429
|
-
title: ( localize(
|
|
430
|
+
title: ( localize(11105, 'Detect system color mode disabled. Click to configure.')),
|
|
430
431
|
icon: Codicon.colorMode,
|
|
431
432
|
isChecked: false,
|
|
432
433
|
...defaultToggleStyles
|
|
433
434
|
}));
|
|
434
435
|
}
|
|
435
436
|
const options = {
|
|
436
|
-
installMessage: ( localize(
|
|
437
|
-
browseMessage: '$(plus) ' + ( localize(
|
|
437
|
+
installMessage: ( localize(11106, "Install Additional Color Themes...")),
|
|
438
|
+
browseMessage: '$(plus) ' + ( localize(11107, "Browse Additional Color Themes...")),
|
|
438
439
|
placeholderMessage: this.getTitle(preferredColorScheme),
|
|
439
440
|
marketplaceTag: 'category:themes',
|
|
440
441
|
toggles: [modeConfigureToggle],
|
|
@@ -449,9 +450,9 @@ registerAction2(class extends Action2 {
|
|
|
449
450
|
const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
|
|
450
451
|
const themes = await themeService.getColorThemes();
|
|
451
452
|
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(
|
|
453
|
+
const lightEntries = toEntries(themes.filter(t => t.type === ColorScheme.LIGHT), ( localize(11108, "light themes")));
|
|
454
|
+
const darkEntries = toEntries(themes.filter(t => t.type === ColorScheme.DARK), ( localize(11109, "dark themes")));
|
|
455
|
+
const hcEntries = toEntries(themes.filter(t => isHighContrast(t.type)), ( localize(11110, "high contrast themes")));
|
|
455
456
|
let picks;
|
|
456
457
|
switch (preferredColorScheme) {
|
|
457
458
|
case ColorScheme.DARK:
|
|
@@ -474,7 +475,7 @@ registerAction2(class extends Action2 {
|
|
|
474
475
|
constructor() {
|
|
475
476
|
super({
|
|
476
477
|
id: SelectFileIconThemeCommandId,
|
|
477
|
-
title: ( localize2(
|
|
478
|
+
title: ( localize2(11111, 'File Icon Theme')),
|
|
478
479
|
category: Categories.Preferences,
|
|
479
480
|
f1: true
|
|
480
481
|
});
|
|
@@ -482,8 +483,8 @@ registerAction2(class extends Action2 {
|
|
|
482
483
|
async run(accessor) {
|
|
483
484
|
const themeService = accessor.get(IWorkbenchThemeService);
|
|
484
485
|
const options = {
|
|
485
|
-
installMessage: ( localize(
|
|
486
|
-
placeholderMessage: ( localize(
|
|
486
|
+
installMessage: ( localize(11112, "Install Additional File Icon Themes...")),
|
|
487
|
+
placeholderMessage: ( localize(11113, "Select File Icon Theme (Up/Down Keys to Preview)")),
|
|
487
488
|
marketplaceTag: 'tag:icon-theme'
|
|
488
489
|
};
|
|
489
490
|
const setTheme = (theme, settingsTarget) => themeService.setFileIconTheme(theme, settingsTarget);
|
|
@@ -491,8 +492,8 @@ registerAction2(class extends Action2 {
|
|
|
491
492
|
const instantiationService = accessor.get(IInstantiationService);
|
|
492
493
|
const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
|
|
493
494
|
const picks = [
|
|
494
|
-
{ type: 'separator', label: ( localize(
|
|
495
|
-
{ id: '', theme: FileIconThemeData.noIconTheme, label: ( localize(
|
|
495
|
+
{ type: 'separator', label: ( localize(11114, 'file icon themes')) },
|
|
496
|
+
{ id: '', theme: FileIconThemeData.noIconTheme, label: ( localize(11115, 'None')), description: ( localize(11116, 'Disable File Icons')) },
|
|
496
497
|
...toEntries(await themeService.getFileIconThemes()),
|
|
497
498
|
];
|
|
498
499
|
await picker.openQuickPick(picks, themeService.getFileIconTheme());
|
|
@@ -503,7 +504,7 @@ registerAction2(class extends Action2 {
|
|
|
503
504
|
constructor() {
|
|
504
505
|
super({
|
|
505
506
|
id: SelectProductIconThemeCommandId,
|
|
506
|
-
title: ( localize2(
|
|
507
|
+
title: ( localize2(11117, 'Product Icon Theme')),
|
|
507
508
|
category: Categories.Preferences,
|
|
508
509
|
f1: true
|
|
509
510
|
});
|
|
@@ -511,9 +512,9 @@ registerAction2(class extends Action2 {
|
|
|
511
512
|
async run(accessor) {
|
|
512
513
|
const themeService = accessor.get(IWorkbenchThemeService);
|
|
513
514
|
const options = {
|
|
514
|
-
installMessage: ( localize(
|
|
515
|
-
browseMessage: '$(plus) ' + ( localize(
|
|
516
|
-
placeholderMessage: ( localize(
|
|
515
|
+
installMessage: ( localize(11118, "Install Additional Product Icon Themes...")),
|
|
516
|
+
browseMessage: '$(plus) ' + ( localize(11119, "Browse Additional Product Icon Themes...")),
|
|
517
|
+
placeholderMessage: ( localize(11120, "Select Product Icon Theme (Up/Down Keys to Preview)")),
|
|
517
518
|
marketplaceTag: 'tag:product-icon-theme'
|
|
518
519
|
};
|
|
519
520
|
const setTheme = (theme, settingsTarget) => themeService.setProductIconTheme(theme, settingsTarget);
|
|
@@ -521,8 +522,8 @@ registerAction2(class extends Action2 {
|
|
|
521
522
|
const instantiationService = accessor.get(IInstantiationService);
|
|
522
523
|
const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
|
|
523
524
|
const picks = [
|
|
524
|
-
{ type: 'separator', label: ( localize(
|
|
525
|
-
{ id: DEFAULT_PRODUCT_ICON_THEME_ID, theme: ProductIconThemeData.defaultTheme, label: ( localize(
|
|
525
|
+
{ type: 'separator', label: ( localize(11121, 'product icon themes')) },
|
|
526
|
+
{ id: DEFAULT_PRODUCT_ICON_THEME_ID, theme: ProductIconThemeData.defaultTheme, label: ( localize(11122, 'Default')) },
|
|
526
527
|
...toEntries(await themeService.getProductIconThemes()),
|
|
527
528
|
];
|
|
528
529
|
await picker.openQuickPick(picks, themeService.getProductIconTheme());
|
|
@@ -580,13 +581,13 @@ function toEntries(themes, label) {
|
|
|
580
581
|
}
|
|
581
582
|
const configureButton = {
|
|
582
583
|
iconClass: ThemeIcon.asClassName(manageExtensionIcon),
|
|
583
|
-
tooltip: ( localize(
|
|
584
|
+
tooltip: ( localize(11123, "Manage Extension")),
|
|
584
585
|
};
|
|
585
586
|
registerAction2(class extends Action2 {
|
|
586
587
|
constructor() {
|
|
587
588
|
super({
|
|
588
589
|
id: 'workbench.action.generateColorTheme',
|
|
589
|
-
title: ( localize2(
|
|
590
|
+
title: ( localize2(11124, 'Generate Color Theme From Current Settings')),
|
|
590
591
|
category: Categories.Developer,
|
|
591
592
|
f1: true
|
|
592
593
|
});
|
|
@@ -636,7 +637,7 @@ registerAction2(class extends Action2 {
|
|
|
636
637
|
constructor() {
|
|
637
638
|
super({
|
|
638
639
|
id: toggleLightDarkThemesCommandId,
|
|
639
|
-
title: ( localize2(
|
|
640
|
+
title: ( localize2(11125, 'Toggle between Light/Dark Themes')),
|
|
640
641
|
category: Categories.Preferences,
|
|
641
642
|
f1: true,
|
|
642
643
|
});
|
|
@@ -648,13 +649,13 @@ registerAction2(class extends Action2 {
|
|
|
648
649
|
const preferencesService = accessor.get(IPreferencesService);
|
|
649
650
|
if (configurationService.getValue(ThemeSettings.DETECT_COLOR_SCHEME)) {
|
|
650
651
|
const message = ( localize(
|
|
651
|
-
|
|
652
|
+
11126,
|
|
652
653
|
"Cannot toggle between light and dark themes when `{0}` is enabled in settings.",
|
|
653
654
|
ThemeSettings.DETECT_COLOR_SCHEME
|
|
654
655
|
));
|
|
655
656
|
notificationService.prompt(Severity.Info, message, [
|
|
656
657
|
{
|
|
657
|
-
label: ( localize(
|
|
658
|
+
label: ( localize(11127, "Open Settings")),
|
|
658
659
|
run: () => {
|
|
659
660
|
return preferencesService.openUserSettings({ query: ThemeSettings.DETECT_COLOR_SCHEME });
|
|
660
661
|
}
|
|
@@ -692,7 +693,7 @@ registerAction2(class extends Action2 {
|
|
|
692
693
|
constructor() {
|
|
693
694
|
super({
|
|
694
695
|
id: browseColorThemesInMarketplaceCommandId,
|
|
695
|
-
title: ( localize2(
|
|
696
|
+
title: ( localize2(11128, 'Browse Color Themes in Marketplace')),
|
|
696
697
|
category: Categories.Preferences,
|
|
697
698
|
f1: true,
|
|
698
699
|
});
|
|
@@ -728,13 +729,13 @@ registerAction2(class extends Action2 {
|
|
|
728
729
|
});
|
|
729
730
|
const ThemesSubMenu = ( new MenuId('ThemesSubMenu'));
|
|
730
731
|
MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
|
|
731
|
-
title: ( localize(
|
|
732
|
+
title: ( localize(11129, "Themes")),
|
|
732
733
|
submenu: ThemesSubMenu,
|
|
733
734
|
group: '2_configuration',
|
|
734
735
|
order: 7
|
|
735
736
|
});
|
|
736
737
|
MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
|
|
737
|
-
title: ( localize(
|
|
738
|
+
title: ( localize(11130, "&&Themes")),
|
|
738
739
|
submenu: ThemesSubMenu,
|
|
739
740
|
group: '2_configuration',
|
|
740
741
|
order: 7
|
|
@@ -742,21 +743,21 @@ MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
|
|
|
742
743
|
MenuRegistry.appendMenuItem(ThemesSubMenu, {
|
|
743
744
|
command: {
|
|
744
745
|
id: SelectColorThemeCommandId,
|
|
745
|
-
title: ( localize(
|
|
746
|
+
title: ( localize(11098, 'Color Theme'))
|
|
746
747
|
},
|
|
747
748
|
order: 1
|
|
748
749
|
});
|
|
749
750
|
MenuRegistry.appendMenuItem(ThemesSubMenu, {
|
|
750
751
|
command: {
|
|
751
752
|
id: SelectFileIconThemeCommandId,
|
|
752
|
-
title: ( localize(
|
|
753
|
+
title: ( localize(11131, "File Icon Theme"))
|
|
753
754
|
},
|
|
754
755
|
order: 2
|
|
755
756
|
});
|
|
756
757
|
MenuRegistry.appendMenuItem(ThemesSubMenu, {
|
|
757
758
|
command: {
|
|
758
759
|
id: SelectProductIconThemeCommandId,
|
|
759
|
-
title: ( localize(
|
|
760
|
+
title: ( localize(11132, "Product Icon Theme"))
|
|
760
761
|
},
|
|
761
762
|
order: 3
|
|
762
763
|
});
|
|
@@ -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
|
+
12607,
|
|
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(12608, "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
|
+
12609,
|
|
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(12610, '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
|
+
12611,
|
|
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(12612, "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
|
+
12613,
|
|
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(12614, '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(12615, '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(12616, '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
|
+
12617,
|
|
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
|
+
12618,
|
|
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(12619, 'Skipping icon definition \'{0}\'. Unknown font.', iconId)));
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
else {
|
|
240
|
-
warnings.push(( localize(
|
|
240
|
+
warnings.push(( localize(12620, 'Skipping icon definition \'{0}\': Needs to be defined', iconId)));
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
return { iconDefinitions };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
|
|
2
2
|
import { IWorkbenchColorTheme, IWorkbenchFileIconTheme, IWorkbenchProductIconTheme, ThemeSettingTarget } from "@codingame/monaco-vscode-9d0168a3-519b-57f3-9bcc-89efc41f951a-common/vscode/vs/workbench/services/themes/common/workbenchThemeService";
|
|
3
|
-
import { IWorkbenchThemeService } from "@codingame/monaco-vscode-
|
|
3
|
+
import { IWorkbenchThemeService } from "@codingame/monaco-vscode-7443a901-21f6-577a-9674-42893b997ee0-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";
|
|
6
6
|
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
7
7
|
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
8
8
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
9
9
|
import { FileIconThemeData } from "./fileIconThemeData.js";
|
|
10
|
-
import { IBrowserWorkbenchEnvironmentService } from "@codingame/monaco-vscode-
|
|
10
|
+
import { IBrowserWorkbenchEnvironmentService } from "@codingame/monaco-vscode-34a0ffd3-b9f5-5699-b43b-38af5732f38a-common/vscode/vs/workbench/services/environment/browser/environmentService.service";
|
|
11
11
|
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
12
12
|
import { IWorkbenchLayoutService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService.service";
|
|
13
13
|
import { IExtensionResourceLoaderService } from "@codingame/monaco-vscode-api/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader.service";
|
|
@@ -15,10 +15,10 @@ import { ColorThemeData } from '@codingame/monaco-vscode-9d0168a3-519b-57f3-9bcc
|
|
|
15
15
|
import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService';
|
|
16
16
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
17
17
|
import { registerFileIconThemeSchemas } from '../common/fileIconThemeSchema.js';
|
|
18
|
-
import { Disposable,
|
|
18
|
+
import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
19
19
|
import { FileIconThemeData, FileIconThemeLoader } from './fileIconThemeData.js';
|
|
20
20
|
import { createStyleSheet, shadowRootContainer } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/domStylesheets';
|
|
21
|
-
import { IBrowserWorkbenchEnvironmentService } from '@codingame/monaco-vscode-
|
|
21
|
+
import { IBrowserWorkbenchEnvironmentService } from '@codingame/monaco-vscode-34a0ffd3-b9f5-5699-b43b-38af5732f38a-common/vscode/vs/workbench/services/environment/browser/environmentService.service';
|
|
22
22
|
import { FileChangeType } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
|
|
23
23
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
24
24
|
import { joinPath, isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
@@ -369,7 +369,7 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
|
|
|
369
369
|
}
|
|
370
370
|
catch (error) {
|
|
371
371
|
throw ( new Error(( localize(
|
|
372
|
-
|
|
372
|
+
12621,
|
|
373
373
|
"Unable to load {0}: {1}",
|
|
374
374
|
themeData.location?.toString(),
|
|
375
375
|
error.message
|
|
@@ -662,24 +662,25 @@ class ThemeFileWatcher {
|
|
|
662
662
|
this.fileService = fileService;
|
|
663
663
|
this.environmentService = environmentService;
|
|
664
664
|
this.onUpdate = onUpdate;
|
|
665
|
+
this.watcherDisposables = ( new DisposableStore());
|
|
665
666
|
}
|
|
666
667
|
update(theme) {
|
|
667
668
|
if (!isEqual(theme.location, this.watchedLocation)) {
|
|
668
|
-
this.
|
|
669
|
+
this.watchedLocation = undefined;
|
|
670
|
+
this.watcherDisposables.clear();
|
|
669
671
|
if (theme.location && (theme.watch || this.environmentService.isExtensionDevelopment)) {
|
|
670
672
|
this.watchedLocation = theme.location;
|
|
671
|
-
this.
|
|
672
|
-
this.fileService.onDidFilesChange(e => {
|
|
673
|
+
this.watcherDisposables.add(this.fileService.watch(theme.location));
|
|
674
|
+
this.watcherDisposables.add(this.fileService.onDidFilesChange(e => {
|
|
673
675
|
if (this.watchedLocation && e.contains(this.watchedLocation, FileChangeType.UPDATED)) {
|
|
674
676
|
this.onUpdate();
|
|
675
677
|
}
|
|
676
|
-
});
|
|
678
|
+
}));
|
|
677
679
|
}
|
|
678
680
|
}
|
|
679
681
|
}
|
|
680
682
|
dispose() {
|
|
681
|
-
this.
|
|
682
|
-
this.fileChangeListener = dispose(this.fileChangeListener);
|
|
683
|
+
this.watcherDisposables.dispose();
|
|
683
684
|
this.watchedLocation = undefined;
|
|
684
685
|
}
|
|
685
686
|
}
|
|
@@ -13,7 +13,7 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/mini
|
|
|
13
13
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/miscColors';
|
|
14
14
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
15
15
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/searchColors';
|
|
16
|
-
import { tokenStylingSchemaId } from '@codingame/monaco-vscode-
|
|
16
|
+
import { tokenStylingSchemaId } from '@codingame/monaco-vscode-7443a901-21f6-577a-9674-42893b997ee0-common/vscode/vs/platform/theme/common/tokenClassificationRegistry';
|
|
17
17
|
|
|
18
18
|
const textMateScopes = [
|
|
19
19
|
'comment',
|
|
@@ -136,31 +136,31 @@ const textmateColorSchema = {
|
|
|
136
136
|
},
|
|
137
137
|
settings: {
|
|
138
138
|
type: 'object',
|
|
139
|
-
description: ( localize(
|
|
139
|
+
description: ( localize(12652, 'Colors and styles for the token.')),
|
|
140
140
|
properties: {
|
|
141
141
|
foreground: {
|
|
142
142
|
type: 'string',
|
|
143
|
-
description: ( localize(
|
|
143
|
+
description: ( localize(12653, '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(12654, 'Token background colors are currently not supported.'))
|
|
150
150
|
},
|
|
151
151
|
fontStyle: {
|
|
152
152
|
type: 'string',
|
|
153
153
|
description: ( localize(
|
|
154
|
-
|
|
154
|
+
12655,
|
|
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
|
+
12656,
|
|
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(12657, '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(12658, 'Description of the rule.'))
|
|
193
193
|
},
|
|
194
194
|
scope: {
|
|
195
|
-
description: ( localize(
|
|
195
|
+
description: ( localize(12659, '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(12660, '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(12661, 'Path to a tmTheme file (relative to the current file).'))
|
|
242
242
|
},
|
|
243
243
|
{
|
|
244
|
-
description: ( localize(
|
|
244
|
+
description: ( localize(12662, '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(12663, 'Whether semantic highlighting should be enabled for this theme.'))
|
|
252
252
|
},
|
|
253
253
|
semanticTokenColors: {
|
|
254
254
|
type: 'object',
|
|
255
|
-
description: ( localize(
|
|
255
|
+
description: ( localize(12664, 'Colors for semantic tokens')),
|
|
256
256
|
$ref: tokenStylingSchemaId
|
|
257
257
|
}
|
|
258
258
|
}
|