@codingame/monaco-vscode-theme-service-override 1.85.0 → 1.85.2

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.
@@ -0,0 +1,8 @@
1
+ var ConfirmResult;
2
+ ( (function(ConfirmResult) {
3
+ ConfirmResult[ConfirmResult["SAVE"] = 0] = "SAVE";
4
+ ConfirmResult[ConfirmResult["DONT_SAVE"] = 1] = "DONT_SAVE";
5
+ ConfirmResult[ConfirmResult["CANCEL"] = 2] = "CANCEL";
6
+ })(ConfirmResult || (ConfirmResult = {})));
7
+
8
+ export { ConfirmResult };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-theme-service-override",
3
- "version": "1.85.0",
3
+ "version": "1.85.2",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,8 +18,8 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@1.85.0",
21
+ "vscode": "npm:@codingame/monaco-vscode-api@1.85.2",
22
22
  "monaco-editor": "0.45.0",
23
- "@codingame/monaco-vscode-files-service-override": "1.85.0"
23
+ "@codingame/monaco-vscode-files-service-override": "1.85.2"
24
24
  }
25
25
  }
package/theme.js CHANGED
@@ -2,6 +2,7 @@ import { WorkbenchThemeService } from './vscode/src/vs/workbench/services/themes
2
2
  import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
3
3
  import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
4
4
  import getServiceOverride$1 from '@codingame/monaco-vscode-files-service-override';
5
+ import './vscode/src/vs/workbench/contrib/themes/browser/themes.contribution.js';
5
6
 
6
7
  class StandaloneWorkbenchThemeService extends WorkbenchThemeService {
7
8
  registerEditorContainer() {
@@ -0,0 +1,947 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
3
+ import { KeyChord } from 'monaco-editor/esm/vs/base/common/keyCodes.js';
4
+ import { registerAction2, Action2, MenuId, MenuRegistry } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
5
+ import { equalsIgnoreCase } from 'monaco-editor/esm/vs/base/common/strings.js';
6
+ import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
7
+ import { Categories } from 'monaco-editor/esm/vs/platform/action/common/actionCommonCategories.js';
8
+ import { IWorkbenchThemeService, ThemeSettings, ThemeSettingDefaults } from 'vscode/vscode/vs/workbench/services/themes/common/workbenchThemeService';
9
+ import { VIEWLET_ID } from 'vscode/vscode/vs/workbench/contrib/extensions/common/extensions';
10
+ import { IExtensionGalleryService, IExtensionManagementService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement';
11
+ import { Extensions } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
12
+ import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
13
+ import { Color } from 'monaco-editor/esm/vs/base/common/color.js';
14
+ import { ColorScheme, isHighContrast } from 'monaco-editor/esm/vs/platform/theme/common/theme.js';
15
+ import { colorThemeSchemaId } from '../../../services/themes/common/colorThemeSchema.js';
16
+ import { onUnexpectedError, isCancellationError } from 'monaco-editor/esm/vs/base/common/errors.js';
17
+ import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
18
+ import { DEFAULT_PRODUCT_ICON_THEME_ID, ProductIconThemeData } from '../../../services/themes/browser/productIconThemeData.js';
19
+ import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite';
20
+ import { ThrottledDelayer } from 'monaco-editor/esm/vs/base/common/async.js';
21
+ import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
22
+ import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
23
+ import { IProgressService } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
24
+ import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
25
+ import { registerIcon } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
26
+ import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
27
+ import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
28
+ import { IExtensionResourceLoaderService } from 'vscode/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader';
29
+ import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
30
+ import { CommandsRegistry, ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
31
+ import { FileIconThemeData } from '../../../services/themes/browser/fileIconThemeData.js';
32
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
33
+ import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
34
+ import { Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/common/contributions';
35
+ import { Severity, INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
36
+ import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
37
+ import { isWeb } from 'monaco-editor/esm/vs/base/common/platform.js';
38
+ import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
39
+ import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
40
+ import { mainWindow } from 'monaco-editor/esm/vs/base/browser/window.js';
41
+ import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
42
+
43
+ var DefaultThemeUpdatedNotificationContribution_1;
44
+ const manageExtensionIcon = registerIcon('theme-selection-manage-extension', Codicon.gear, ( localizeWithPath(
45
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
46
+ 'manageExtensionIcon',
47
+ 'Icon for the \'Manage\' action in the theme selection quick pick.'
48
+ )));
49
+ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
50
+ constructor(getMarketplaceColorThemes, marketplaceQuery, extensionGalleryService, extensionManagementService, quickInputService, logService, progressService, paneCompositeService, dialogService) {
51
+ this.getMarketplaceColorThemes = getMarketplaceColorThemes;
52
+ this.marketplaceQuery = marketplaceQuery;
53
+ this.extensionGalleryService = extensionGalleryService;
54
+ this.extensionManagementService = extensionManagementService;
55
+ this.quickInputService = quickInputService;
56
+ this.logService = logService;
57
+ this.progressService = progressService;
58
+ this.paneCompositeService = paneCompositeService;
59
+ this.dialogService = dialogService;
60
+ this._marketplaceExtensions = ( new Set());
61
+ this._marketplaceThemes = [];
62
+ this._searchOngoing = false;
63
+ this._searchError = undefined;
64
+ this._onDidChange = ( new Emitter());
65
+ this._queryDelayer = ( new ThrottledDelayer(200));
66
+ this._installedExtensions = extensionManagementService.getInstalled().then(installed => {
67
+ const result = ( new Set());
68
+ for (const ext of installed) {
69
+ result.add(ext.identifier.id);
70
+ }
71
+ return result;
72
+ });
73
+ }
74
+ get themes() {
75
+ return this._marketplaceThemes;
76
+ }
77
+ get onDidChange() {
78
+ return this._onDidChange.event;
79
+ }
80
+ trigger(value) {
81
+ if (this._tokenSource) {
82
+ this._tokenSource.cancel();
83
+ this._tokenSource = undefined;
84
+ }
85
+ this._queryDelayer.trigger(() => {
86
+ this._tokenSource = ( new CancellationTokenSource());
87
+ return this.doSearch(value, this._tokenSource.token);
88
+ });
89
+ }
90
+ async doSearch(value, token) {
91
+ this._searchOngoing = true;
92
+ this._onDidChange.fire();
93
+ try {
94
+ const installedExtensions = await this._installedExtensions;
95
+ const options = { text: `${this.marketplaceQuery} ${value}`, pageSize: 20 };
96
+ const pager = await this.extensionGalleryService.query(options, token);
97
+ for (let i = 0; i < pager.total && i < 1; i++) {
98
+ if (token.isCancellationRequested) {
99
+ break;
100
+ }
101
+ const nThemes = this._marketplaceThemes.length;
102
+ const gallery = i === 0 ? pager.firstPage : await pager.getPage(i, token);
103
+ const promises = [];
104
+ const promisesGalleries = [];
105
+ for (let i = 0; i < gallery.length; i++) {
106
+ if (token.isCancellationRequested) {
107
+ break;
108
+ }
109
+ const ext = gallery[i];
110
+ if (!( installedExtensions.has(ext.identifier.id)) && !( this._marketplaceExtensions.has(ext.identifier.id))) {
111
+ this._marketplaceExtensions.add(ext.identifier.id);
112
+ promises.push(this.getMarketplaceColorThemes(ext.publisher, ext.name, ext.version));
113
+ promisesGalleries.push(ext);
114
+ }
115
+ }
116
+ const allThemes = await Promise.all(promises);
117
+ for (let i = 0; i < allThemes.length; i++) {
118
+ const ext = promisesGalleries[i];
119
+ for (const theme of allThemes[i]) {
120
+ this._marketplaceThemes.push({ id: theme.id, theme: theme, label: theme.label, description: `${ext.displayName} · ${ext.publisherDisplayName}`, galleryExtension: ext, buttons: [configureButton] });
121
+ }
122
+ }
123
+ if (nThemes !== this._marketplaceThemes.length) {
124
+ this._marketplaceThemes.sort((t1, t2) => t1.label.localeCompare(t2.label));
125
+ this._onDidChange.fire();
126
+ }
127
+ }
128
+ }
129
+ catch (e) {
130
+ if (!isCancellationError(e)) {
131
+ this.logService.error(`Error while searching for themes:`, e);
132
+ this._searchError = 'message' in e ? e.message : String(e);
133
+ }
134
+ }
135
+ finally {
136
+ this._searchOngoing = false;
137
+ this._onDidChange.fire();
138
+ }
139
+ }
140
+ openQuickPick(value, currentTheme, selectTheme) {
141
+ let result = undefined;
142
+ return ( new Promise((s, _) => {
143
+ const quickpick = this.quickInputService.createQuickPick();
144
+ quickpick.items = [];
145
+ quickpick.sortByLabel = false;
146
+ quickpick.matchOnDescription = true;
147
+ quickpick.buttons = [this.quickInputService.backButton];
148
+ quickpick.title = 'Marketplace Themes';
149
+ quickpick.placeholder = ( localizeWithPath(
150
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
151
+ 'themes.selectMarketplaceTheme',
152
+ "Type to Search More. Select to Install. Up/Down Keys to Preview"
153
+ ));
154
+ quickpick.canSelectMany = false;
155
+ quickpick.onDidChangeValue(() => this.trigger(quickpick.value));
156
+ quickpick.onDidAccept(async (_) => {
157
+ const themeItem = quickpick.selectedItems[0];
158
+ if (themeItem?.galleryExtension) {
159
+ result = 'selected';
160
+ quickpick.hide();
161
+ const success = await this.installExtension(themeItem.galleryExtension);
162
+ if (success) {
163
+ selectTheme(themeItem.theme, true);
164
+ }
165
+ else {
166
+ selectTheme(currentTheme, true);
167
+ }
168
+ }
169
+ });
170
+ quickpick.onDidTriggerItemButton(e => {
171
+ if (isItem(e.item)) {
172
+ const extensionId = e.item.theme?.extensionData?.extensionId;
173
+ if (extensionId) {
174
+ openExtensionViewlet(this.paneCompositeService, `@id:${extensionId}`);
175
+ }
176
+ else {
177
+ openExtensionViewlet(this.paneCompositeService, `${this.marketplaceQuery} ${quickpick.value}`);
178
+ }
179
+ }
180
+ });
181
+ quickpick.onDidChangeActive(themes => {
182
+ if (result === undefined) {
183
+ selectTheme(themes[0]?.theme, false);
184
+ }
185
+ });
186
+ quickpick.onDidHide(() => {
187
+ if (result === undefined) {
188
+ selectTheme(currentTheme, true);
189
+ result = 'cancelled';
190
+ }
191
+ quickpick.dispose();
192
+ s(result);
193
+ });
194
+ quickpick.onDidTriggerButton(e => {
195
+ if (e === this.quickInputService.backButton) {
196
+ result = 'back';
197
+ quickpick.hide();
198
+ }
199
+ });
200
+ this.onDidChange(() => {
201
+ let items = this.themes;
202
+ if (this._searchOngoing) {
203
+ items = items.concat({ label: '$(sync~spin) Searching for themes...', id: undefined, alwaysShow: true });
204
+ }
205
+ else if (items.length === 0 && this._searchError) {
206
+ items = [{ label: `$(error) ${( localizeWithPath(
207
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
208
+ 'search.error',
209
+ 'Error while searching for themes: {0}',
210
+ this._searchError
211
+ ))}`, id: undefined, alwaysShow: true }];
212
+ }
213
+ const activeItemId = quickpick.activeItems[0]?.id;
214
+ const newActiveItem = activeItemId ? items.find(i => isItem(i) && i.id === activeItemId) : undefined;
215
+ quickpick.items = items;
216
+ if (newActiveItem) {
217
+ quickpick.activeItems = [newActiveItem];
218
+ }
219
+ });
220
+ this.trigger(value);
221
+ quickpick.show();
222
+ }));
223
+ }
224
+ async installExtension(galleryExtension) {
225
+ openExtensionViewlet(this.paneCompositeService, `@id:${galleryExtension.identifier.id}`);
226
+ const result = await this.dialogService.confirm({
227
+ message: ( localizeWithPath(
228
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
229
+ 'installExtension.confirm',
230
+ "This will install extension '{0}' published by '{1}'. Do you want to continue?",
231
+ galleryExtension.displayName,
232
+ galleryExtension.publisherDisplayName
233
+ )),
234
+ primaryButton: ( localizeWithPath(
235
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
236
+ 'installExtension.button.ok',
237
+ "OK"
238
+ ))
239
+ });
240
+ if (!result.confirmed) {
241
+ return false;
242
+ }
243
+ try {
244
+ await this.progressService.withProgress({
245
+ location: 15 ,
246
+ title: ( localizeWithPath(
247
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
248
+ 'installing extensions',
249
+ "Installing Extension {0}...",
250
+ galleryExtension.displayName
251
+ ))
252
+ }, async () => {
253
+ await this.extensionManagementService.installFromGallery(galleryExtension, {
254
+ isMachineScoped: false,
255
+ });
256
+ });
257
+ return true;
258
+ }
259
+ catch (e) {
260
+ this.logService.error(`Problem installing extension ${galleryExtension.identifier.id}`, e);
261
+ return false;
262
+ }
263
+ }
264
+ dispose() {
265
+ if (this._tokenSource) {
266
+ this._tokenSource.cancel();
267
+ this._tokenSource = undefined;
268
+ }
269
+ this._queryDelayer.dispose();
270
+ this._marketplaceExtensions.clear();
271
+ this._marketplaceThemes.length = 0;
272
+ }
273
+ };
274
+ MarketplaceThemesPicker = ( __decorate([
275
+ ( __param(2, IExtensionGalleryService)),
276
+ ( __param(3, IExtensionManagementService)),
277
+ ( __param(4, IQuickInputService)),
278
+ ( __param(5, ILogService)),
279
+ ( __param(6, IProgressService)),
280
+ ( __param(7, IPaneCompositePartService)),
281
+ ( __param(8, IDialogService))
282
+ ], MarketplaceThemesPicker));
283
+ let InstalledThemesPicker = class InstalledThemesPicker {
284
+ constructor(installMessage, browseMessage, placeholderMessage, marketplaceTag, setTheme, getMarketplaceColorThemes, quickInputService, extensionGalleryService, paneCompositeService, extensionResourceLoaderService, instantiationService) {
285
+ this.installMessage = installMessage;
286
+ this.browseMessage = browseMessage;
287
+ this.placeholderMessage = placeholderMessage;
288
+ this.marketplaceTag = marketplaceTag;
289
+ this.setTheme = setTheme;
290
+ this.getMarketplaceColorThemes = getMarketplaceColorThemes;
291
+ this.quickInputService = quickInputService;
292
+ this.extensionGalleryService = extensionGalleryService;
293
+ this.paneCompositeService = paneCompositeService;
294
+ this.extensionResourceLoaderService = extensionResourceLoaderService;
295
+ this.instantiationService = instantiationService;
296
+ }
297
+ async openQuickPick(picks, currentTheme) {
298
+ let marketplaceThemePicker;
299
+ if (this.extensionGalleryService.isEnabled()) {
300
+ if (this.extensionResourceLoaderService.supportsExtensionGalleryResources && this.browseMessage) {
301
+ marketplaceThemePicker = this.instantiationService.createInstance(MarketplaceThemesPicker, this.getMarketplaceColorThemes.bind(this), this.marketplaceTag);
302
+ picks = [...configurationEntries(this.browseMessage), ...picks];
303
+ }
304
+ else {
305
+ picks = [...picks, ...configurationEntries(this.installMessage)];
306
+ }
307
+ }
308
+ let selectThemeTimeout;
309
+ const selectTheme = (theme, applyTheme) => {
310
+ if (selectThemeTimeout) {
311
+ clearTimeout(selectThemeTimeout);
312
+ }
313
+ selectThemeTimeout = mainWindow.setTimeout(() => {
314
+ selectThemeTimeout = undefined;
315
+ const newTheme = (theme ?? currentTheme);
316
+ this.setTheme(newTheme, applyTheme ? 'auto' : 'preview').then(undefined, err => {
317
+ onUnexpectedError(err);
318
+ this.setTheme(currentTheme, undefined);
319
+ });
320
+ }, applyTheme ? 0 : 200);
321
+ };
322
+ const pickInstalledThemes = (activeItemId) => {
323
+ return ( new Promise((s, _) => {
324
+ let isCompleted = false;
325
+ const autoFocusIndex = picks.findIndex(p => isItem(p) && p.id === activeItemId);
326
+ const quickpick = this.quickInputService.createQuickPick();
327
+ quickpick.items = picks;
328
+ quickpick.placeholder = this.placeholderMessage;
329
+ quickpick.activeItems = [picks[autoFocusIndex]];
330
+ quickpick.canSelectMany = false;
331
+ quickpick.matchOnDescription = true;
332
+ quickpick.onDidAccept(async (_) => {
333
+ isCompleted = true;
334
+ const theme = quickpick.selectedItems[0];
335
+ if (!theme || typeof theme.id === 'undefined') {
336
+ if (marketplaceThemePicker) {
337
+ const res = await marketplaceThemePicker.openQuickPick(quickpick.value, currentTheme, selectTheme);
338
+ if (res === 'back') {
339
+ await pickInstalledThemes(undefined);
340
+ }
341
+ }
342
+ else {
343
+ openExtensionViewlet(this.paneCompositeService, `${this.marketplaceTag} ${quickpick.value}`);
344
+ }
345
+ }
346
+ else {
347
+ selectTheme(theme.theme, true);
348
+ }
349
+ quickpick.hide();
350
+ s();
351
+ });
352
+ quickpick.onDidChangeActive(themes => selectTheme(themes[0]?.theme, false));
353
+ quickpick.onDidHide(() => {
354
+ if (!isCompleted) {
355
+ selectTheme(currentTheme, true);
356
+ s();
357
+ }
358
+ quickpick.dispose();
359
+ });
360
+ quickpick.onDidTriggerItemButton(e => {
361
+ if (isItem(e.item)) {
362
+ const extensionId = e.item.theme?.extensionData?.extensionId;
363
+ if (extensionId) {
364
+ openExtensionViewlet(this.paneCompositeService, `@id:${extensionId}`);
365
+ }
366
+ else {
367
+ openExtensionViewlet(this.paneCompositeService, `${this.marketplaceTag} ${quickpick.value}`);
368
+ }
369
+ }
370
+ });
371
+ quickpick.show();
372
+ }));
373
+ };
374
+ await pickInstalledThemes(currentTheme.id);
375
+ marketplaceThemePicker?.dispose();
376
+ }
377
+ };
378
+ InstalledThemesPicker = ( __decorate([
379
+ ( __param(6, IQuickInputService)),
380
+ ( __param(7, IExtensionGalleryService)),
381
+ ( __param(8, IPaneCompositePartService)),
382
+ ( __param(9, IExtensionResourceLoaderService)),
383
+ ( __param(10, IInstantiationService))
384
+ ], InstalledThemesPicker));
385
+ const SelectColorThemeCommandId = 'workbench.action.selectTheme';
386
+ registerAction2(class extends Action2 {
387
+ constructor() {
388
+ super({
389
+ id: SelectColorThemeCommandId,
390
+ title: { value: ( localizeWithPath(
391
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
392
+ 'selectTheme.label',
393
+ "Color Theme"
394
+ )), original: 'Color Theme' },
395
+ category: Categories.Preferences,
396
+ f1: true,
397
+ keybinding: {
398
+ weight: 200 ,
399
+ primary: KeyChord(2048 | 41 , 2048 | 50 )
400
+ }
401
+ });
402
+ }
403
+ async run(accessor) {
404
+ const themeService = accessor.get(IWorkbenchThemeService);
405
+ const installMessage = ( localizeWithPath(
406
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
407
+ 'installColorThemes',
408
+ "Install Additional Color Themes..."
409
+ ));
410
+ const browseMessage = '$(plus) ' + ( localizeWithPath(
411
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
412
+ 'browseColorThemes',
413
+ "Browse Additional Color Themes..."
414
+ ));
415
+ const placeholderMessage = ( localizeWithPath(
416
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
417
+ 'themes.selectTheme',
418
+ "Select Color Theme (Up/Down Keys to Preview)"
419
+ ));
420
+ const marketplaceTag = 'category:themes';
421
+ const setTheme = (theme, settingsTarget) => themeService.setColorTheme(theme, settingsTarget);
422
+ const getMarketplaceColorThemes = (publisher, name, version) => themeService.getMarketplaceColorThemes(publisher, name, version);
423
+ const instantiationService = accessor.get(IInstantiationService);
424
+ const picker = instantiationService.createInstance(InstalledThemesPicker, installMessage, browseMessage, placeholderMessage, marketplaceTag, setTheme, getMarketplaceColorThemes);
425
+ const themes = await themeService.getColorThemes();
426
+ const currentTheme = themeService.getColorTheme();
427
+ const picks = [
428
+ ...toEntries(themes.filter(t => t.type === ColorScheme.LIGHT), ( localizeWithPath(
429
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
430
+ 'themes.category.light',
431
+ "light themes"
432
+ ))),
433
+ ...toEntries(themes.filter(t => t.type === ColorScheme.DARK), ( localizeWithPath(
434
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
435
+ 'themes.category.dark',
436
+ "dark themes"
437
+ ))),
438
+ ...toEntries(themes.filter(t => isHighContrast(t.type)), ( localizeWithPath(
439
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
440
+ 'themes.category.hc',
441
+ "high contrast themes"
442
+ ))),
443
+ ];
444
+ await picker.openQuickPick(picks, currentTheme);
445
+ }
446
+ });
447
+ const SelectFileIconThemeCommandId = 'workbench.action.selectIconTheme';
448
+ registerAction2(class extends Action2 {
449
+ constructor() {
450
+ super({
451
+ id: SelectFileIconThemeCommandId,
452
+ title: { value: ( localizeWithPath(
453
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
454
+ 'selectIconTheme.label',
455
+ "File Icon Theme"
456
+ )), original: 'File Icon Theme' },
457
+ category: Categories.Preferences,
458
+ f1: true
459
+ });
460
+ }
461
+ async run(accessor) {
462
+ const themeService = accessor.get(IWorkbenchThemeService);
463
+ const installMessage = ( localizeWithPath(
464
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
465
+ 'installIconThemes',
466
+ "Install Additional File Icon Themes..."
467
+ ));
468
+ const placeholderMessage = ( localizeWithPath(
469
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
470
+ 'themes.selectIconTheme',
471
+ "Select File Icon Theme (Up/Down Keys to Preview)"
472
+ ));
473
+ const marketplaceTag = 'tag:icon-theme';
474
+ const setTheme = (theme, settingsTarget) => themeService.setFileIconTheme(theme, settingsTarget);
475
+ const getMarketplaceColorThemes = (publisher, name, version) => themeService.getMarketplaceFileIconThemes(publisher, name, version);
476
+ const instantiationService = accessor.get(IInstantiationService);
477
+ const picker = instantiationService.createInstance(InstalledThemesPicker, installMessage, undefined, placeholderMessage, marketplaceTag, setTheme, getMarketplaceColorThemes);
478
+ const picks = [
479
+ { type: 'separator', label: ( localizeWithPath(
480
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
481
+ 'fileIconThemeCategory',
482
+ 'file icon themes'
483
+ )) },
484
+ { id: '', theme: FileIconThemeData.noIconTheme, label: ( localizeWithPath(
485
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
486
+ 'noIconThemeLabel',
487
+ 'None'
488
+ )), description: ( localizeWithPath(
489
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
490
+ 'noIconThemeDesc',
491
+ 'Disable File Icons'
492
+ )) },
493
+ ...toEntries(await themeService.getFileIconThemes()),
494
+ ];
495
+ await picker.openQuickPick(picks, themeService.getFileIconTheme());
496
+ }
497
+ });
498
+ const SelectProductIconThemeCommandId = 'workbench.action.selectProductIconTheme';
499
+ registerAction2(class extends Action2 {
500
+ constructor() {
501
+ super({
502
+ id: SelectProductIconThemeCommandId,
503
+ title: { value: ( localizeWithPath(
504
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
505
+ 'selectProductIconTheme.label',
506
+ "Product Icon Theme"
507
+ )), original: 'Product Icon Theme' },
508
+ category: Categories.Preferences,
509
+ f1: true
510
+ });
511
+ }
512
+ async run(accessor) {
513
+ const themeService = accessor.get(IWorkbenchThemeService);
514
+ const installMessage = ( localizeWithPath(
515
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
516
+ 'installProductIconThemes',
517
+ "Install Additional Product Icon Themes..."
518
+ ));
519
+ const browseMessage = '$(plus) ' + ( localizeWithPath(
520
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
521
+ 'browseProductIconThemes',
522
+ "Browse Additional Product Icon Themes..."
523
+ ));
524
+ const placeholderMessage = ( localizeWithPath(
525
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
526
+ 'themes.selectProductIconTheme',
527
+ "Select Product Icon Theme (Up/Down Keys to Preview)"
528
+ ));
529
+ const marketplaceTag = 'tag:product-icon-theme';
530
+ const setTheme = (theme, settingsTarget) => themeService.setProductIconTheme(theme, settingsTarget);
531
+ const getMarketplaceColorThemes = (publisher, name, version) => themeService.getMarketplaceProductIconThemes(publisher, name, version);
532
+ const instantiationService = accessor.get(IInstantiationService);
533
+ const picker = instantiationService.createInstance(InstalledThemesPicker, installMessage, browseMessage, placeholderMessage, marketplaceTag, setTheme, getMarketplaceColorThemes);
534
+ const picks = [
535
+ { type: 'separator', label: ( localizeWithPath(
536
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
537
+ 'productIconThemeCategory',
538
+ 'product icon themes'
539
+ )) },
540
+ { id: DEFAULT_PRODUCT_ICON_THEME_ID, theme: ProductIconThemeData.defaultTheme, label: ( localizeWithPath(
541
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
542
+ 'defaultProductIconThemeLabel',
543
+ 'Default'
544
+ )) },
545
+ ...toEntries(await themeService.getProductIconThemes()),
546
+ ];
547
+ await picker.openQuickPick(picks, themeService.getProductIconTheme());
548
+ }
549
+ });
550
+ CommandsRegistry.registerCommand('workbench.action.previewColorTheme', async function (accessor, extension, themeSettingsId) {
551
+ const themeService = accessor.get(IWorkbenchThemeService);
552
+ let themes = findBuiltInThemes(await themeService.getColorThemes(), extension);
553
+ if (themes.length === 0) {
554
+ themes = await themeService.getMarketplaceColorThemes(extension.publisher, extension.name, extension.version);
555
+ }
556
+ for (const theme of themes) {
557
+ if (!themeSettingsId || theme.settingsId === themeSettingsId) {
558
+ await themeService.setColorTheme(theme, 'preview');
559
+ return theme.settingsId;
560
+ }
561
+ }
562
+ return undefined;
563
+ });
564
+ function findBuiltInThemes(themes, extension) {
565
+ return themes.filter(({ extensionData }) => extensionData && extensionData.extensionIsBuiltin && equalsIgnoreCase(extensionData.extensionPublisher, extension.publisher) && equalsIgnoreCase(extensionData.extensionName, extension.name));
566
+ }
567
+ function configurationEntries(label) {
568
+ return [
569
+ {
570
+ type: 'separator'
571
+ },
572
+ {
573
+ id: undefined,
574
+ label: label,
575
+ alwaysShow: true,
576
+ buttons: [configureButton]
577
+ }
578
+ ];
579
+ }
580
+ function openExtensionViewlet(paneCompositeService, query) {
581
+ return paneCompositeService.openPaneComposite(VIEWLET_ID, 0 , true).then(viewlet => {
582
+ if (viewlet) {
583
+ (viewlet?.getViewPaneContainer()).search(query);
584
+ viewlet.focus();
585
+ }
586
+ });
587
+ }
588
+ function isItem(i) {
589
+ return i['type'] !== 'separator';
590
+ }
591
+ function toEntry(theme) {
592
+ const settingId = theme.settingsId ?? undefined;
593
+ const item = {
594
+ id: theme.id,
595
+ theme: theme,
596
+ label: theme.label,
597
+ description: theme.description || (theme.label === settingId ? undefined : settingId),
598
+ };
599
+ if (theme.extensionData) {
600
+ item.buttons = [configureButton];
601
+ }
602
+ return item;
603
+ }
604
+ function toEntries(themes, label) {
605
+ const sorter = (t1, t2) => t1.label.localeCompare(t2.label);
606
+ const entries = ( themes.map(toEntry)).sort(sorter);
607
+ if (entries.length > 0 && label) {
608
+ entries.unshift({ type: 'separator', label });
609
+ }
610
+ return entries;
611
+ }
612
+ const configureButton = {
613
+ iconClass: ThemeIcon.asClassName(manageExtensionIcon),
614
+ tooltip: ( localizeWithPath(
615
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
616
+ 'manage extension',
617
+ "Manage Extension"
618
+ )),
619
+ };
620
+ registerAction2(class extends Action2 {
621
+ constructor() {
622
+ super({
623
+ id: 'workbench.action.generateColorTheme',
624
+ title: { value: ( localizeWithPath(
625
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
626
+ 'generateColorTheme.label',
627
+ "Generate Color Theme From Current Settings"
628
+ )), original: 'Generate Color Theme From Current Settings' },
629
+ category: Categories.Developer,
630
+ f1: true
631
+ });
632
+ }
633
+ run(accessor) {
634
+ const themeService = accessor.get(IWorkbenchThemeService);
635
+ const theme = themeService.getColorTheme();
636
+ const colors = ( Registry.as(Extensions.ColorContribution)).getColors();
637
+ const colorIds = ( colors.map(c => c.id)).sort();
638
+ const resultingColors = {};
639
+ const inherited = [];
640
+ for (const colorId of colorIds) {
641
+ const color = theme.getColor(colorId, false);
642
+ if (color) {
643
+ resultingColors[colorId] = Color.Format.CSS.formatHexA(color, true);
644
+ }
645
+ else {
646
+ inherited.push(colorId);
647
+ }
648
+ }
649
+ const nullDefaults = [];
650
+ for (const id of inherited) {
651
+ const color = theme.getColor(id);
652
+ if (color) {
653
+ resultingColors['__' + id] = Color.Format.CSS.formatHexA(color, true);
654
+ }
655
+ else {
656
+ nullDefaults.push(id);
657
+ }
658
+ }
659
+ for (const id of nullDefaults) {
660
+ resultingColors['__' + id] = null;
661
+ }
662
+ let contents = JSON.stringify({
663
+ '$schema': colorThemeSchemaId,
664
+ type: theme.type,
665
+ colors: resultingColors,
666
+ tokenColors: theme.tokenColors.filter(t => !!t.scope)
667
+ }, null, '\t');
668
+ contents = contents.replace(/\"__/g, '//"');
669
+ const editorService = accessor.get(IEditorService);
670
+ return editorService.openEditor({ resource: undefined, contents, languageId: 'jsonc', options: { pinned: true } });
671
+ }
672
+ });
673
+ const toggleLightDarkThemesCommandId = 'workbench.action.toggleLightDarkThemes';
674
+ registerAction2(class extends Action2 {
675
+ constructor() {
676
+ super({
677
+ id: toggleLightDarkThemesCommandId,
678
+ title: { value: ( localizeWithPath(
679
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
680
+ 'toggleLightDarkThemes.label',
681
+ "Toggle between Light/Dark Themes"
682
+ )), original: 'Toggle between Light/Dark Themes' },
683
+ category: Categories.Preferences,
684
+ f1: true,
685
+ });
686
+ }
687
+ async run(accessor) {
688
+ const themeService = accessor.get(IWorkbenchThemeService);
689
+ const configurationService = accessor.get(IConfigurationService);
690
+ const currentTheme = themeService.getColorTheme();
691
+ let newSettingsId = ThemeSettings.PREFERRED_DARK_THEME;
692
+ switch (currentTheme.type) {
693
+ case ColorScheme.LIGHT:
694
+ newSettingsId = ThemeSettings.PREFERRED_DARK_THEME;
695
+ break;
696
+ case ColorScheme.DARK:
697
+ newSettingsId = ThemeSettings.PREFERRED_LIGHT_THEME;
698
+ break;
699
+ case ColorScheme.HIGH_CONTRAST_LIGHT:
700
+ newSettingsId = ThemeSettings.PREFERRED_HC_DARK_THEME;
701
+ break;
702
+ case ColorScheme.HIGH_CONTRAST_DARK:
703
+ newSettingsId = ThemeSettings.PREFERRED_HC_LIGHT_THEME;
704
+ break;
705
+ }
706
+ const themeSettingId = configurationService.getValue(newSettingsId);
707
+ if (themeSettingId && typeof themeSettingId === 'string') {
708
+ const theme = (await themeService.getColorThemes()).find(t => t.settingsId === themeSettingId);
709
+ if (theme) {
710
+ themeService.setColorTheme(theme.id, 'auto');
711
+ }
712
+ }
713
+ }
714
+ });
715
+ const browseColorThemesInMarketplaceCommandId = 'workbench.action.browseColorThemesInMarketplace';
716
+ registerAction2(class extends Action2 {
717
+ constructor() {
718
+ super({
719
+ id: browseColorThemesInMarketplaceCommandId,
720
+ title: { value: ( localizeWithPath(
721
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
722
+ 'browseColorThemeInMarketPlace.label',
723
+ "Browse Color Themes in Marketplace"
724
+ )), original: 'Browse Color Themes in Marketplace' },
725
+ category: Categories.Preferences,
726
+ f1: true,
727
+ });
728
+ }
729
+ async run(accessor) {
730
+ const marketplaceTag = 'category:themes';
731
+ const themeService = accessor.get(IWorkbenchThemeService);
732
+ const extensionGalleryService = accessor.get(IExtensionGalleryService);
733
+ const extensionResourceLoaderService = accessor.get(IExtensionResourceLoaderService);
734
+ const instantiationService = accessor.get(IInstantiationService);
735
+ if (!extensionGalleryService.isEnabled() || !extensionResourceLoaderService.supportsExtensionGalleryResources) {
736
+ return;
737
+ }
738
+ const currentTheme = themeService.getColorTheme();
739
+ const getMarketplaceColorThemes = (publisher, name, version) => themeService.getMarketplaceColorThemes(publisher, name, version);
740
+ let selectThemeTimeout;
741
+ const selectTheme = (theme, applyTheme) => {
742
+ if (selectThemeTimeout) {
743
+ clearTimeout(selectThemeTimeout);
744
+ }
745
+ selectThemeTimeout = mainWindow.setTimeout(() => {
746
+ selectThemeTimeout = undefined;
747
+ const newTheme = (theme ?? currentTheme);
748
+ themeService.setColorTheme(newTheme, applyTheme ? 'auto' : 'preview').then(undefined, err => {
749
+ onUnexpectedError(err);
750
+ themeService.setColorTheme(currentTheme, undefined);
751
+ });
752
+ }, applyTheme ? 0 : 200);
753
+ };
754
+ const marketplaceThemePicker = instantiationService.createInstance(MarketplaceThemesPicker, getMarketplaceColorThemes, marketplaceTag);
755
+ await marketplaceThemePicker.openQuickPick('', themeService.getColorTheme(), selectTheme).then(undefined, onUnexpectedError);
756
+ }
757
+ });
758
+ const ThemesSubMenu = ( new MenuId('ThemesSubMenu'));
759
+ MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
760
+ title: ( localizeWithPath(
761
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
762
+ 'themes',
763
+ "Themes"
764
+ )),
765
+ submenu: ThemesSubMenu,
766
+ group: '2_configuration',
767
+ order: 7
768
+ });
769
+ MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
770
+ title: ( localizeWithPath(
771
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
772
+ { key: 'miSelectTheme', comment: ['&& denotes a mnemonic'] },
773
+ "&&Theme"
774
+ )),
775
+ submenu: ThemesSubMenu,
776
+ group: '2_configuration',
777
+ order: 7
778
+ });
779
+ MenuRegistry.appendMenuItem(ThemesSubMenu, {
780
+ command: {
781
+ id: SelectColorThemeCommandId,
782
+ title: ( localizeWithPath(
783
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
784
+ 'selectTheme.label',
785
+ "Color Theme"
786
+ ))
787
+ },
788
+ order: 1
789
+ });
790
+ MenuRegistry.appendMenuItem(ThemesSubMenu, {
791
+ command: {
792
+ id: SelectFileIconThemeCommandId,
793
+ title: ( localizeWithPath(
794
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
795
+ 'themes.selectIconTheme.label',
796
+ "File Icon Theme"
797
+ ))
798
+ },
799
+ order: 2
800
+ });
801
+ MenuRegistry.appendMenuItem(ThemesSubMenu, {
802
+ command: {
803
+ id: SelectProductIconThemeCommandId,
804
+ title: ( localizeWithPath(
805
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
806
+ 'themes.selectProductIconTheme.label',
807
+ "Product Icon Theme"
808
+ ))
809
+ },
810
+ order: 3
811
+ });
812
+ let DefaultThemeUpdatedNotificationContribution = class DefaultThemeUpdatedNotificationContribution {
813
+ static { DefaultThemeUpdatedNotificationContribution_1 = this; }
814
+ static { this.STORAGE_KEY = 'themeUpdatedNotificationShown'; }
815
+ constructor(_notificationService, _workbenchThemeService, _storageService, _commandService, _telemetryService, _hostService) {
816
+ this._notificationService = _notificationService;
817
+ this._workbenchThemeService = _workbenchThemeService;
818
+ this._storageService = _storageService;
819
+ this._commandService = _commandService;
820
+ this._telemetryService = _telemetryService;
821
+ this._hostService = _hostService;
822
+ if (_storageService.getBoolean(DefaultThemeUpdatedNotificationContribution_1.STORAGE_KEY, -1 )) {
823
+ return;
824
+ }
825
+ setTimeout(async () => {
826
+ if (_storageService.getBoolean(DefaultThemeUpdatedNotificationContribution_1.STORAGE_KEY, -1 )) {
827
+ return;
828
+ }
829
+ if (await this._hostService.hadLastFocus()) {
830
+ this._storageService.store(DefaultThemeUpdatedNotificationContribution_1.STORAGE_KEY, true, -1 , 0 );
831
+ if (this._workbenchThemeService.hasUpdatedDefaultThemes()) {
832
+ this._showYouGotMigratedNotification();
833
+ }
834
+ else {
835
+ const currentTheme = this._workbenchThemeService.getColorTheme().settingsId;
836
+ if (currentTheme === ThemeSettingDefaults.COLOR_THEME_LIGHT_OLD || currentTheme === ThemeSettingDefaults.COLOR_THEME_DARK_OLD) {
837
+ this._tryNewThemeNotification();
838
+ }
839
+ }
840
+ }
841
+ }, 3000);
842
+ }
843
+ async _showYouGotMigratedNotification() {
844
+ const usingLight = this._workbenchThemeService.getColorTheme().type === ColorScheme.LIGHT;
845
+ const newThemeSettingsId = usingLight ? ThemeSettingDefaults.COLOR_THEME_LIGHT : ThemeSettingDefaults.COLOR_THEME_DARK;
846
+ const newTheme = (await this._workbenchThemeService.getColorThemes()).find(theme => theme.settingsId === newThemeSettingsId);
847
+ if (newTheme) {
848
+ const choices = [
849
+ {
850
+ label: ( localizeWithPath(
851
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
852
+ 'button.keep',
853
+ "Keep New Theme"
854
+ )),
855
+ run: () => {
856
+ this._writeTelemetry('keepNew');
857
+ }
858
+ },
859
+ {
860
+ label: ( localizeWithPath(
861
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
862
+ 'button.browse',
863
+ "Browse Themes"
864
+ )),
865
+ run: () => {
866
+ this._writeTelemetry('browse');
867
+ this._commandService.executeCommand(SelectColorThemeCommandId);
868
+ }
869
+ },
870
+ {
871
+ label: ( localizeWithPath(
872
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
873
+ 'button.revert',
874
+ "Revert"
875
+ )),
876
+ run: async () => {
877
+ this._writeTelemetry('keepOld');
878
+ const oldSettingsId = usingLight ? ThemeSettingDefaults.COLOR_THEME_LIGHT_OLD : ThemeSettingDefaults.COLOR_THEME_DARK_OLD;
879
+ const oldTheme = (await this._workbenchThemeService.getColorThemes()).find(theme => theme.settingsId === oldSettingsId);
880
+ if (oldTheme) {
881
+ this._workbenchThemeService.setColorTheme(oldTheme, 'auto');
882
+ }
883
+ }
884
+ }
885
+ ];
886
+ await this._notificationService.prompt(Severity.Info, ( localizeWithPath(
887
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
888
+ { key: 'themeUpdatedNotification', comment: ['{0} is the name of the new default theme'] },
889
+ "Visual Studio Code now ships with a new default theme '{0}'. If you prefer, you can switch back to the old theme or try one of the many other color themes available.",
890
+ newTheme.label
891
+ )), choices, {
892
+ onCancel: () => this._writeTelemetry('cancel')
893
+ });
894
+ }
895
+ }
896
+ async _tryNewThemeNotification() {
897
+ const newThemeSettingsId = this._workbenchThemeService.getColorTheme().type === ColorScheme.LIGHT ? ThemeSettingDefaults.COLOR_THEME_LIGHT : ThemeSettingDefaults.COLOR_THEME_DARK;
898
+ const theme = (await this._workbenchThemeService.getColorThemes()).find(theme => theme.settingsId === newThemeSettingsId);
899
+ if (theme) {
900
+ const choices = [{
901
+ label: ( localizeWithPath(
902
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
903
+ 'button.tryTheme',
904
+ "Try New Theme"
905
+ )),
906
+ run: () => {
907
+ this._writeTelemetry('tryNew');
908
+ this._workbenchThemeService.setColorTheme(theme, 'auto');
909
+ }
910
+ },
911
+ {
912
+ label: ( localizeWithPath(
913
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
914
+ 'button.cancel',
915
+ "Cancel"
916
+ )),
917
+ run: () => {
918
+ this._writeTelemetry('cancel');
919
+ }
920
+ }];
921
+ await this._notificationService.prompt(Severity.Info, ( localizeWithPath(
922
+ 'vs/workbench/contrib/themes/browser/themes.contribution',
923
+ { key: 'newThemeNotification', comment: ['{0} is the name of the new default theme'] },
924
+ "Visual Studio Code now ships with a new default theme '{0}'. Do you want to give it a try?",
925
+ theme.label
926
+ )), choices, { onCancel: () => this._writeTelemetry('cancel') });
927
+ }
928
+ }
929
+ _writeTelemetry(outcome) {
930
+ this._telemetryService.publicLog2('themeUpdatedNotication', {
931
+ web: isWeb,
932
+ reaction: outcome
933
+ });
934
+ }
935
+ };
936
+ DefaultThemeUpdatedNotificationContribution = DefaultThemeUpdatedNotificationContribution_1 = ( __decorate([
937
+ ( __param(0, INotificationService)),
938
+ ( __param(1, IWorkbenchThemeService)),
939
+ ( __param(2, IStorageService)),
940
+ ( __param(3, ICommandService)),
941
+ ( __param(4, ITelemetryService)),
942
+ ( __param(5, IHostService))
943
+ ], DefaultThemeUpdatedNotificationContribution));
944
+ const workbenchRegistry = ( Registry.as(Extensions$1.Workbench));
945
+ workbenchRegistry.registerWorkbenchContribution(DefaultThemeUpdatedNotificationContribution, 4 );
946
+
947
+ export { manageExtensionIcon };
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
2
  import * as nls from 'monaco-editor/esm/vs/nls.js';
3
- import * as types from 'monaco-editor/esm/vs/base/common/types.js';
3
+ import * as Types from 'monaco-editor/esm/vs/base/common/types.js';
4
4
  import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
5
5
  import { ThemeSettingDefaults, COLOR_THEME_LIGHT_INITIAL_COLORS, COLOR_THEME_DARK_INITIAL_COLORS, ThemeSettings, ExtensionData, VS_DARK_THEME, VS_LIGHT_THEME, VS_HC_THEME, VS_HC_LIGHT_THEME } from 'vscode/vscode/vs/workbench/services/themes/common/workbenchThemeService';
6
6
  import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
@@ -261,7 +261,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
261
261
  this.colorThemeRegistry.onDidChange(async (event) => {
262
262
  updateColorThemeConfigurationSchemas(event.themes);
263
263
  if (await this.restoreColorTheme()) {
264
- if (this.currentColorTheme.settingsId === ThemeSettingDefaults.COLOR_THEME_DARK && !types.isUndefined(prevColorId) && (await this.colorThemeRegistry.findThemeById(prevColorId))) {
264
+ if (this.currentColorTheme.settingsId === ThemeSettingDefaults.COLOR_THEME_DARK && !Types.isUndefined(prevColorId) && (await this.colorThemeRegistry.findThemeById(prevColorId))) {
265
265
  await this.setColorTheme(prevColorId, 'auto');
266
266
  prevColorId = undefined;
267
267
  }
@@ -279,7 +279,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
279
279
  this.fileIconThemeRegistry.onDidChange(async (event) => {
280
280
  updateFileIconThemeConfigurationSchemas(event.themes);
281
281
  if (await this.restoreFileIconTheme()) {
282
- if (this.currentFileIconTheme.id === DEFAULT_FILE_ICON_THEME_ID && !types.isUndefined(prevFileIconId) && this.fileIconThemeRegistry.findThemeById(prevFileIconId)) {
282
+ if (this.currentFileIconTheme.id === DEFAULT_FILE_ICON_THEME_ID && !Types.isUndefined(prevFileIconId) && this.fileIconThemeRegistry.findThemeById(prevFileIconId)) {
283
283
  await this.setFileIconTheme(prevFileIconId, 'auto');
284
284
  prevFileIconId = undefined;
285
285
  }
@@ -296,7 +296,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
296
296
  this.productIconThemeRegistry.onDidChange(async (event) => {
297
297
  updateProductIconThemeConfigurationSchemas(event.themes);
298
298
  if (await this.restoreProductIconTheme()) {
299
- if (this.currentProductIconTheme.id === DEFAULT_PRODUCT_ICON_THEME_ID && !types.isUndefined(prevProductIconId) && this.productIconThemeRegistry.findThemeById(prevProductIconId)) {
299
+ if (this.currentProductIconTheme.id === DEFAULT_PRODUCT_ICON_THEME_ID && !Types.isUndefined(prevProductIconId) && this.productIconThemeRegistry.findThemeById(prevProductIconId)) {
300
300
  await this.setProductIconTheme(prevProductIconId, 'auto');
301
301
  prevProductIconId = undefined;
302
302
  }
@@ -406,7 +406,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
406
406
  if (!themeIdOrTheme) {
407
407
  return null;
408
408
  }
409
- const themeId = types.isString(themeIdOrTheme) ? validateThemeId(themeIdOrTheme) : themeIdOrTheme.id;
409
+ const themeId = Types.isString(themeIdOrTheme) ? validateThemeId(themeIdOrTheme) : themeIdOrTheme.id;
410
410
  if (this.currentColorTheme.isLoaded && themeId === this.currentColorTheme.id) {
411
411
  if (settingsTarget !== 'preview') {
412
412
  this.currentColorTheme.toStorage(this.storageService);
@@ -541,7 +541,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
541
541
  if (iconThemeOrId === undefined) {
542
542
  iconThemeOrId = '';
543
543
  }
544
- const themeId = types.isString(iconThemeOrId) ? iconThemeOrId : iconThemeOrId.id;
544
+ const themeId = Types.isString(iconThemeOrId) ? iconThemeOrId : iconThemeOrId.id;
545
545
  if (themeId !== this.currentFileIconTheme.id || !this.currentFileIconTheme.isLoaded) {
546
546
  let newThemeData = this.fileIconThemeRegistry.findThemeById(themeId);
547
547
  if (!newThemeData && iconThemeOrId instanceof FileIconThemeData) {
@@ -631,7 +631,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
631
631
  if (iconThemeOrId === undefined) {
632
632
  iconThemeOrId = '';
633
633
  }
634
- const themeId = types.isString(iconThemeOrId) ? iconThemeOrId : iconThemeOrId.id;
634
+ const themeId = Types.isString(iconThemeOrId) ? iconThemeOrId : iconThemeOrId.id;
635
635
  if (themeId !== this.currentProductIconTheme.id || !this.currentProductIconTheme.isLoaded) {
636
636
  let newThemeData = this.productIconThemeRegistry.findThemeById(themeId);
637
637
  if (!newThemeData && iconThemeOrId instanceof ProductIconThemeData) {
@@ -4,7 +4,7 @@ import { Color } from 'monaco-editor/esm/vs/base/common/color.js';
4
4
  import { THEME_SCOPE_OPEN_PAREN, THEME_SCOPE_CLOSE_PAREN, THEME_SCOPE_WILDCARD, themeScopeRegex, ExtensionData, VS_HC_LIGHT_THEME, VS_HC_THEME, VS_LIGHT_THEME } from 'vscode/vscode/vs/workbench/services/themes/common/workbenchThemeService';
5
5
  import { convertSettings } from './themeCompatibility.js';
6
6
  import * as nls from 'monaco-editor/esm/vs/nls.js';
7
- import * as types from 'monaco-editor/esm/vs/base/common/types.js';
7
+ import * as Types from 'monaco-editor/esm/vs/base/common/types.js';
8
8
  import * as resources from 'monaco-editor/esm/vs/base/common/resources.js';
9
9
  import { Extensions, editorForeground, editorBackground } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
10
10
  import { getThemeTypeSelector } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
@@ -86,7 +86,7 @@ class ColorThemeData {
86
86
  return color;
87
87
  }
88
88
  color = this.colorMap[colorId];
89
- if (useDefault !== false && types.isUndefined(color)) {
89
+ if (useDefault !== false && Types.isUndefined(color)) {
90
90
  color = this.getDefault(colorId);
91
91
  }
92
92
  return color;
@@ -251,7 +251,7 @@ class ColorThemeData {
251
251
  foregroundScore = score;
252
252
  foregroundThemingRule = themingRule;
253
253
  }
254
- if (score >= fontStyleScore && types.isString(settings.fontStyle)) {
254
+ if (score >= fontStyleScore && Types.isString(settings.fontStyle)) {
255
255
  fontStyle = settings.fontStyle;
256
256
  fontStyleScore = score;
257
257
  fontStyleThemingRule = themingRule;
@@ -284,7 +284,7 @@ class ColorThemeData {
284
284
  this.customColorMap = {};
285
285
  this.overwriteCustomColors(colors);
286
286
  const themeSpecificColors = this.getThemeSpecificColors(colors);
287
- if (types.isObject(themeSpecificColors)) {
287
+ if (Types.isObject(themeSpecificColors)) {
288
288
  this.overwriteCustomColors(themeSpecificColors);
289
289
  }
290
290
  this.tokenColorIndex = undefined;
@@ -304,7 +304,7 @@ class ColorThemeData {
304
304
  this.customSemanticHighlightingDeprecated = undefined;
305
305
  this.addCustomTokenColors(customTokenColors);
306
306
  const themeSpecificTokenColors = this.getThemeSpecificColors(customTokenColors);
307
- if (types.isObject(themeSpecificTokenColors)) {
307
+ if (Types.isObject(themeSpecificTokenColors)) {
308
308
  this.addCustomTokenColors(themeSpecificTokenColors);
309
309
  }
310
310
  this.tokenColorIndex = undefined;
@@ -320,7 +320,7 @@ class ColorThemeData {
320
320
  this.readSemanticTokenRules(semanticTokenColors.rules);
321
321
  }
322
322
  const themeSpecificColors = this.getThemeSpecificColors(semanticTokenColors);
323
- if (types.isObject(themeSpecificColors)) {
323
+ if (Types.isObject(themeSpecificColors)) {
324
324
  if (themeSpecificColors.enabled !== undefined) {
325
325
  this.customSemanticHighlighting = themeSpecificColors.enabled;
326
326
  }
@@ -799,8 +799,8 @@ function readSemanticTokenRule(selectorString, settings) {
799
799
  return undefined;
800
800
  }
801
801
  function isSemanticTokenColorizationSetting(style) {
802
- return style && (types.isString(style.foreground) || types.isString(style.fontStyle) || types.isBoolean(style.italic)
803
- || types.isBoolean(style.underline) || types.isBoolean(style.strikethrough) || types.isBoolean(style.bold));
802
+ return style && (Types.isString(style.foreground) || Types.isString(style.fontStyle) || Types.isBoolean(style.italic)
803
+ || Types.isBoolean(style.underline) || Types.isBoolean(style.strikethrough) || Types.isBoolean(style.bold));
804
804
  }
805
805
  class TokenColorIndex {
806
806
  constructor() {
@@ -1,5 +1,5 @@
1
1
  import * as nls from 'monaco-editor/esm/vs/nls.js';
2
- import * as types from 'monaco-editor/esm/vs/base/common/types.js';
2
+ import * as Types from 'monaco-editor/esm/vs/base/common/types.js';
3
3
  import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
4
4
  import { Extensions } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
5
5
  import { textmateColorsSchemaId, textmateColorGroupSchemaId } from './colorThemeSchema.js';
@@ -419,13 +419,13 @@ class ThemeConfiguration {
419
419
  }
420
420
  findAutoConfigurationTarget(key) {
421
421
  const settings = this.configurationService.inspect(key);
422
- if (!types.isUndefined(settings.workspaceFolderValue)) {
422
+ if (!Types.isUndefined(settings.workspaceFolderValue)) {
423
423
  return 6 ;
424
424
  }
425
- else if (!types.isUndefined(settings.workspaceValue)) {
425
+ else if (!Types.isUndefined(settings.workspaceValue)) {
426
426
  return 5 ;
427
427
  }
428
- else if (!types.isUndefined(settings.userRemote)) {
428
+ else if (!Types.isUndefined(settings.userRemote)) {
429
429
  return 4 ;
430
430
  }
431
431
  return 2 ;
@@ -443,7 +443,7 @@ class ThemeConfiguration {
443
443
  return Promise.resolve(undefined);
444
444
  }
445
445
  else if (value === settings.defaultValue) {
446
- if (types.isUndefined(settings.userValue)) {
446
+ if (Types.isUndefined(settings.userValue)) {
447
447
  return Promise.resolve(undefined);
448
448
  }
449
449
  value = undefined;
@@ -1,5 +1,5 @@
1
1
  import * as nls from 'monaco-editor/esm/vs/nls.js';
2
- import * as types from 'monaco-editor/esm/vs/base/common/types.js';
2
+ import * as Types from 'monaco-editor/esm/vs/base/common/types.js';
3
3
  import * as resources from 'monaco-editor/esm/vs/base/common/resources.js';
4
4
  import { ExtensionsRegistry } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
5
5
  import { VS_DARK_THEME, VS_LIGHT_THEME, VS_HC_THEME, VS_HC_LIGHT_THEME, ExtensionData } from 'vscode/vscode/vs/workbench/services/themes/common/workbenchThemeService';
@@ -191,7 +191,7 @@ class ThemeRegistry {
191
191
  return resultingThemes;
192
192
  }
193
193
  themeContributions.forEach(theme => {
194
- if (!theme.path || !types.isString(theme.path)) {
194
+ if (!theme.path || !Types.isString(theme.path)) {
195
195
  log?.error(( nls.localizeWithPath(
196
196
  'vs/workbench/services/themes/common/themeExtensionPoints',
197
197
  'reqpath',
@@ -201,7 +201,7 @@ class ThemeRegistry {
201
201
  )));
202
202
  return;
203
203
  }
204
- if (this.idRequired && (!theme.id || !types.isString(theme.id))) {
204
+ if (this.idRequired && (!theme.id || !Types.isString(theme.id))) {
205
205
  log?.error(( nls.localizeWithPath(
206
206
  'vs/workbench/services/themes/common/themeExtensionPoints',
207
207
  'reqid',