@codingame/monaco-vscode-theme-service-override 5.3.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-theme-service-override",
3
- "version": "5.3.0",
3
+ "version": "6.0.1",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -26,7 +26,7 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@5.3.0",
30
- "@codingame/monaco-vscode-files-service-override": "5.3.0"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@6.0.1",
30
+ "@codingame/monaco-vscode-files-service-override": "6.0.1"
31
31
  }
32
32
  }
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
3
- import { KeyChord } from 'vscode/vscode/vs/base/common/keyCodes';
3
+ import { KeyChord, KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
4
4
  import { registerAction2, Action2, MenuId, MenuRegistry } from 'vscode/vscode/vs/platform/actions/common/actions';
5
5
  import { equalsIgnoreCase } from 'vscode/vscode/vs/base/common/strings';
6
6
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
@@ -28,9 +28,11 @@ import { isCancellationError, onUnexpectedError } from 'vscode/vscode/vs/base/co
28
28
  import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
29
29
  import { DEFAULT_PRODUCT_ICON_THEME_ID, ProductIconThemeData } from '../../../services/themes/browser/productIconThemeData.js';
30
30
  import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service';
31
+ import { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
31
32
  import { ThrottledDelayer } from 'vscode/vscode/vs/base/common/async';
32
33
  import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
33
34
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
35
+ import { ProgressLocation } from 'vscode/vscode/vs/platform/progress/common/progress';
34
36
  import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/progress.service';
35
37
  import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
36
38
  import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
@@ -38,14 +40,17 @@ import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
38
40
  import { Emitter } from 'vscode/vscode/vs/base/common/event';
39
41
  import { IExtensionResourceLoaderService } from 'vscode/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader.service';
40
42
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
43
+ import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
41
44
  import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
42
45
  import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
43
46
  import { FileIconThemeData } from '../../../services/themes/browser/fileIconThemeData.js';
44
47
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
45
48
  import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
46
49
  import { Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/common/contributions';
50
+ import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
47
51
  import 'vscode/vscode/vs/platform/notification/common/notification';
48
52
  import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
53
+ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
49
54
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
50
55
  import { isWeb } from 'vscode/vscode/vs/base/common/platform';
51
56
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
@@ -259,7 +264,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
259
264
  }
260
265
  try {
261
266
  await this.progressService.withProgress({
262
- location: 15 ,
267
+ location: ProgressLocation.Notification,
263
268
  title: ( localizeWithPath(_moduleId, 5, "Installing Extension {0}...", galleryExtension.displayName))
264
269
  }, async () => {
265
270
  await this.extensionManagementService.installFromGallery(galleryExtension, {
@@ -412,8 +417,8 @@ registerAction2(class extends Action2 {
412
417
  category: Categories.Preferences,
413
418
  f1: true,
414
419
  keybinding: {
415
- weight: 200 ,
416
- primary: KeyChord(2048 | 41 , 2048 | 50 )
420
+ weight: KeybindingWeight.WorkbenchContrib,
421
+ primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyT)
417
422
  }
418
423
  });
419
424
  }
@@ -571,7 +576,7 @@ function configurationEntry(label, configureItem) {
571
576
  };
572
577
  }
573
578
  function openExtensionViewlet(paneCompositeService, query) {
574
- return paneCompositeService.openPaneComposite(VIEWLET_ID, 0 , true).then(viewlet => {
579
+ return paneCompositeService.openPaneComposite(VIEWLET_ID, ViewContainerLocation.Sidebar, true).then(viewlet => {
575
580
  if (viewlet) {
576
581
  (viewlet?.getViewPaneContainer()).search(query);
577
582
  viewlet.focus();
@@ -795,15 +800,15 @@ let DefaultThemeUpdatedNotificationContribution = class DefaultThemeUpdatedNotif
795
800
  this._commandService = _commandService;
796
801
  this._telemetryService = _telemetryService;
797
802
  this._hostService = _hostService;
798
- if (_storageService.getBoolean(DefaultThemeUpdatedNotificationContribution_1.STORAGE_KEY, -1 )) {
803
+ if (_storageService.getBoolean(DefaultThemeUpdatedNotificationContribution_1.STORAGE_KEY, StorageScope.APPLICATION)) {
799
804
  return;
800
805
  }
801
806
  setTimeout(async () => {
802
- if (_storageService.getBoolean(DefaultThemeUpdatedNotificationContribution_1.STORAGE_KEY, -1 )) {
807
+ if (_storageService.getBoolean(DefaultThemeUpdatedNotificationContribution_1.STORAGE_KEY, StorageScope.APPLICATION)) {
803
808
  return;
804
809
  }
805
810
  if (await this._hostService.hadLastFocus()) {
806
- this._storageService.store(DefaultThemeUpdatedNotificationContribution_1.STORAGE_KEY, true, -1 , 0 );
811
+ this._storageService.store(DefaultThemeUpdatedNotificationContribution_1.STORAGE_KEY, true, StorageScope.APPLICATION, StorageTarget.USER);
807
812
  if (this._workbenchThemeService.hasUpdatedDefaultThemes()) {
808
813
  this._showYouGotMigratedNotification();
809
814
  }
@@ -898,6 +903,6 @@ DefaultThemeUpdatedNotificationContribution = DefaultThemeUpdatedNotificationCon
898
903
  ( (__param(5, IHostService)))
899
904
  ], DefaultThemeUpdatedNotificationContribution)));
900
905
  const workbenchRegistry = ( (Registry.as(Extensions$1.Workbench)));
901
- workbenchRegistry.registerWorkbenchContribution(DefaultThemeUpdatedNotificationContribution, 4 );
906
+ workbenchRegistry.registerWorkbenchContribution(DefaultThemeUpdatedNotificationContribution, LifecyclePhase.Eventually);
902
907
 
903
908
  export { manageExtensionIcon };
@@ -5,6 +5,7 @@ import { parse, getNodeType } from 'vscode/vscode/vs/base/common/json';
5
5
  import { ExtensionData } from 'vscode/vscode/vs/workbench/services/themes/common/workbenchThemeService';
6
6
  import { getParseErrorMessage } from 'vscode/vscode/vs/base/common/jsonErrorMessages';
7
7
  import { asCSSUrl } from 'vscode/vscode/vs/base/browser/dom';
8
+ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
8
9
  import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
9
10
 
10
11
  const _moduleId = "vs/workbench/services/themes/browser/fileIconThemeData";
@@ -65,7 +66,7 @@ class FileIconThemeData {
65
66
  return themeData;
66
67
  }
67
68
  static fromStorageData(storageService) {
68
- const input = storageService.get(FileIconThemeData.STORAGE_KEY, 0 );
69
+ const input = storageService.get(FileIconThemeData.STORAGE_KEY, StorageScope.PROFILE);
69
70
  if (!input) {
70
71
  return undefined;
71
72
  }
@@ -111,7 +112,7 @@ class FileIconThemeData {
111
112
  extensionData: ExtensionData.toJSONObject(this.extensionData),
112
113
  watch: this.watch
113
114
  });
114
- storageService.store(FileIconThemeData.STORAGE_KEY, data, 0 , 1 );
115
+ storageService.store(FileIconThemeData.STORAGE_KEY, data, StorageScope.PROFILE, StorageTarget.MACHINE);
115
116
  }
116
117
  }
117
118
  class FileIconThemeLoader {
@@ -4,6 +4,7 @@ import { dirname, joinPath } from 'vscode/vscode/vs/base/common/resources';
4
4
  import { parse, getNodeType } from 'vscode/vscode/vs/base/common/json';
5
5
  import { ThemeSettingDefaults, ExtensionData } from 'vscode/vscode/vs/workbench/services/themes/common/workbenchThemeService';
6
6
  import { getParseErrorMessage } from 'vscode/vscode/vs/base/common/jsonErrorMessages';
7
+ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
7
8
  import { fontIdRegex, fontWeightRegex, fontStyleRegex, fontFormatRegex } from '../common/productIconThemeSchema.js';
8
9
  import { isObject, isString } from 'vscode/vscode/vs/base/common/types';
9
10
  import { IconFontDefinition, getIconRegistry } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
@@ -79,7 +80,7 @@ class ProductIconThemeData {
79
80
  return themeData;
80
81
  }
81
82
  static fromStorageData(storageService) {
82
- const input = storageService.get(ProductIconThemeData.STORAGE_KEY, 0 );
83
+ const input = storageService.get(ProductIconThemeData.STORAGE_KEY, StorageScope.PROFILE);
83
84
  if (!input) {
84
85
  return undefined;
85
86
  }
@@ -149,7 +150,7 @@ class ProductIconThemeData {
149
150
  iconDefinitions,
150
151
  iconFontDefinitions
151
152
  });
152
- storageService.store(ProductIconThemeData.STORAGE_KEY, data, 0 , 1 );
153
+ storageService.store(ProductIconThemeData.STORAGE_KEY, data, StorageScope.PROFILE, StorageTarget.MACHINE);
153
154
  }
154
155
  }
155
156
  function _loadProductIconThemeDocument(fileService, location, warnings) {
@@ -8,6 +8,7 @@ import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storag
8
8
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
9
9
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
10
10
  import { onUnexpectedError } from 'vscode/vscode/vs/base/common/errors';
11
+ import { ConfigurationTarget } from 'vscode/vscode/vs/platform/configuration/common/configuration';
11
12
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
12
13
  import { ColorThemeData } from '../common/colorThemeData.js';
13
14
  import { Extensions } from 'vscode/vscode/vs/platform/theme/common/themeService';
@@ -17,9 +18,11 @@ import { Disposable, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
17
18
  import { FileIconThemeData, FileIconThemeLoader } from './fileIconThemeData.js';
18
19
  import { createStyleSheet } from 'vscode/vscode/vs/base/browser/dom';
19
20
  import { IBrowserWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/browser/environmentService.service';
21
+ import { FileChangeType } from 'vscode/vscode/vs/platform/files/common/files';
20
22
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
21
23
  import { joinPath, isEqual } from 'vscode/vscode/vs/base/common/resources';
22
24
  import { registerColorThemeSchemas } from '../common/colorThemeSchema.js';
25
+ import 'vscode/vscode/vs/platform/instantiation/common/extensions';
23
26
  import { getRemoteAuthority } from 'vscode/vscode/vs/platform/remote/common/remoteHosts';
24
27
  import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
25
28
  import { IExtensionResourceLoaderService } from 'vscode/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader.service';
@@ -180,7 +183,7 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
180
183
  const initializeFileIconTheme = async () => {
181
184
  const devThemes = this.fileIconThemeRegistry.findThemeByExtensionLocation(extDevLoc);
182
185
  if (devThemes.length) {
183
- return this.setFileIconTheme(devThemes[0].id, 8 );
186
+ return this.setFileIconTheme(devThemes[0].id, ConfigurationTarget.MEMORY);
184
187
  }
185
188
  let theme = this.fileIconThemeRegistry.findThemeBySettingsId(this.settings.fileIconTheme);
186
189
  if (!theme) {
@@ -192,7 +195,7 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
192
195
  const initializeProductIconTheme = async () => {
193
196
  const devThemes = this.productIconThemeRegistry.findThemeByExtensionLocation(extDevLoc);
194
197
  if (devThemes.length) {
195
- return this.setProductIconTheme(devThemes[0].id, 8 );
198
+ return this.setProductIconTheme(devThemes[0].id, ConfigurationTarget.MEMORY);
196
199
  }
197
200
  let theme = this.productIconThemeRegistry.findThemeBySettingsId(this.settings.productIconTheme);
198
201
  if (!theme) {
@@ -303,7 +306,11 @@ let WorkbenchThemeService = class WorkbenchThemeService extends Disposable {
303
306
  });
304
307
  }
305
308
  installPreferredSchemeListener() {
306
- this._register(this.hostColorService.onDidChangeColorScheme(() => this.restoreColorTheme()));
309
+ this._register(this.hostColorService.onDidChangeColorScheme(() => {
310
+ if (this.settings.isDetectingColorScheme()) {
311
+ this.restoreColorTheme();
312
+ }
313
+ }));
307
314
  }
308
315
  hasUpdatedDefaultThemes() {
309
316
  return this.hasDefaultUpdated;
@@ -667,7 +674,7 @@ class ThemeFileWatcher {
667
674
  this.watchedLocation = theme.location;
668
675
  this.watcherDisposable = this.fileService.watch(theme.location);
669
676
  this.fileService.onDidFilesChange(e => {
670
- if (this.watchedLocation && e.contains(this.watchedLocation, 0 )) {
677
+ if (this.watchedLocation && e.contains(this.watchedLocation, FileChangeType.UPDATED)) {
671
678
  this.onUpdate();
672
679
  }
673
680
  });
@@ -23,6 +23,8 @@ import { getParseErrorMessage } from 'vscode/vscode/vs/base/common/jsonErrorMess
23
23
  import { parse as parse$1 } from './plistParser.js';
24
24
  import { getTokenClassificationRegistry, TokenStyle, parseClassifierString, SemanticTokenRule } from 'vscode/vscode/vs/platform/theme/common/tokenClassificationRegistry';
25
25
  import { createMatchers } from './textMateScopeMatcher.js';
26
+ import { CharCode } from 'vscode/vscode/vs/base/common/charCode';
27
+ import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
26
28
  import { ColorScheme } from 'vscode/vscode/vs/platform/theme/common/theme';
27
29
 
28
30
  const _moduleId = "vs/workbench/services/themes/common/colorThemeData";
@@ -471,7 +473,7 @@ class ColorThemeData {
471
473
  colorMap: colorMapData,
472
474
  watch: this.watch
473
475
  });
474
- storageService.store(ColorThemeData.STORAGE_KEY, value, 0 , 0 );
476
+ storageService.store(ColorThemeData.STORAGE_KEY, value, StorageScope.PROFILE, StorageTarget.USER);
475
477
  }
476
478
  get baseTheme() {
477
479
  return this.classNames[0];
@@ -510,7 +512,7 @@ class ColorThemeData {
510
512
  return themeData;
511
513
  }
512
514
  static fromStorageData(storageService) {
513
- const input = storageService.get(ColorThemeData.STORAGE_KEY, 0 );
515
+ const input = storageService.get(ColorThemeData.STORAGE_KEY, StorageScope.PROFILE);
514
516
  if (!input) {
515
517
  return undefined;
516
518
  }
@@ -848,10 +850,10 @@ function normalizeColor(color) {
848
850
  color = Color.Format.CSS.formatHexA(color, true);
849
851
  }
850
852
  const len = color.length;
851
- if (color.charCodeAt(0) !== 35 || (len !== 4 && len !== 5 && len !== 7 && len !== 9)) {
853
+ if (color.charCodeAt(0) !== CharCode.Hash || (len !== 4 && len !== 5 && len !== 7 && len !== 9)) {
852
854
  return undefined;
853
855
  }
854
- const result = [35 ];
856
+ const result = [CharCode.Hash];
855
857
  for (let i = 1; i < len; i++) {
856
858
  const upper = hexUpper(color.charCodeAt(i));
857
859
  if (!upper) {
@@ -862,17 +864,17 @@ function normalizeColor(color) {
862
864
  result.push(upper);
863
865
  }
864
866
  }
865
- if (result.length === 9 && result[7] === 70 && result[8] === 70 ) {
867
+ if (result.length === 9 && result[7] === CharCode.F && result[8] === CharCode.F) {
866
868
  result.length = 7;
867
869
  }
868
870
  return String.fromCharCode(...result);
869
871
  }
870
872
  function hexUpper(charCode) {
871
- if (charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 ) {
873
+ if (charCode >= CharCode.Digit0 && charCode <= CharCode.Digit9 || charCode >= CharCode.A && charCode <= CharCode.F) {
872
874
  return charCode;
873
875
  }
874
- else if (charCode >= 97 && charCode <= 102 ) {
875
- return charCode - 97 + 65 ;
876
+ else if (charCode >= CharCode.a && charCode <= CharCode.f) {
877
+ return charCode - CharCode.a + CharCode.A;
876
878
  }
877
879
  return 0;
878
880
  }
@@ -1,10 +1,28 @@
1
+ var ChCode;
2
+ ( (function(ChCode) {
3
+ ChCode[ChCode["BOM"] = 65279] = "BOM";
4
+ ChCode[ChCode["SPACE"] = 32] = "SPACE";
5
+ ChCode[ChCode["TAB"] = 9] = "TAB";
6
+ ChCode[ChCode["CARRIAGE_RETURN"] = 13] = "CARRIAGE_RETURN";
7
+ ChCode[ChCode["LINE_FEED"] = 10] = "LINE_FEED";
8
+ ChCode[ChCode["SLASH"] = 47] = "SLASH";
9
+ ChCode[ChCode["LESS_THAN"] = 60] = "LESS_THAN";
10
+ ChCode[ChCode["QUESTION_MARK"] = 63] = "QUESTION_MARK";
11
+ ChCode[ChCode["EXCLAMATION_MARK"] = 33] = "EXCLAMATION_MARK";
12
+ })(ChCode || (ChCode = {})));
13
+ var State;
14
+ ( (function(State) {
15
+ State[State["ROOT_STATE"] = 0] = "ROOT_STATE";
16
+ State[State["DICT_STATE"] = 1] = "DICT_STATE";
17
+ State[State["ARR_STATE"] = 2] = "ARR_STATE";
18
+ })(State || (State = {})));
1
19
  function parse(content) {
2
20
  return _parse(content);
3
21
  }
4
22
  function _parse(content, filename, locationKeyName) {
5
23
  const len = content.length;
6
24
  let pos = 0;
7
- if (len > 0 && content.charCodeAt(0) === 65279 ) {
25
+ if (len > 0 && content.charCodeAt(0) === ChCode.BOM) {
8
26
  pos = 1;
9
27
  }
10
28
  function advancePosBy(by) {
@@ -20,7 +38,7 @@ function _parse(content, filename, locationKeyName) {
20
38
  function skipWhitespace() {
21
39
  while (pos < len) {
22
40
  const chCode = content.charCodeAt(pos);
23
- if (chCode !== 32 && chCode !== 9 && chCode !== 13 && chCode !== 10 ) {
41
+ if (chCode !== ChCode.SPACE && chCode !== ChCode.TAB && chCode !== ChCode.CARRIAGE_RETURN && chCode !== ChCode.LINE_FEED) {
24
42
  break;
25
43
  }
26
44
  advancePosBy(1);
@@ -55,7 +73,7 @@ function _parse(content, filename, locationKeyName) {
55
73
  return r;
56
74
  }
57
75
  }
58
- let state = 0 ;
76
+ let state = State.ROOT_STATE;
59
77
  let cur = null;
60
78
  const stateStack = [];
61
79
  const objStack = [];
@@ -86,7 +104,7 @@ function _parse(content, filename, locationKeyName) {
86
104
  const newDict = {};
87
105
  cur[curKey] = newDict;
88
106
  curKey = null;
89
- pushState(1 , newDict);
107
+ pushState(State.DICT_STATE, newDict);
90
108
  },
91
109
  enterArray: function () {
92
110
  if (curKey === null) {
@@ -95,38 +113,38 @@ function _parse(content, filename, locationKeyName) {
95
113
  const newArr = [];
96
114
  cur[curKey] = newArr;
97
115
  curKey = null;
98
- pushState(2 , newArr);
116
+ pushState(State.ARR_STATE, newArr);
99
117
  }
100
118
  };
101
119
  const arrState = {
102
120
  enterDict: function () {
103
121
  const newDict = {};
104
122
  cur.push(newDict);
105
- pushState(1 , newDict);
123
+ pushState(State.DICT_STATE, newDict);
106
124
  },
107
125
  enterArray: function () {
108
126
  const newArr = [];
109
127
  cur.push(newArr);
110
- pushState(2 , newArr);
128
+ pushState(State.ARR_STATE, newArr);
111
129
  }
112
130
  };
113
131
  function enterDict() {
114
- if (state === 1 ) {
132
+ if (state === State.DICT_STATE) {
115
133
  dictState.enterDict();
116
134
  }
117
- else if (state === 2 ) {
135
+ else if (state === State.ARR_STATE) {
118
136
  arrState.enterDict();
119
137
  }
120
138
  else {
121
139
  cur = {};
122
- pushState(1 , cur);
140
+ pushState(State.DICT_STATE, cur);
123
141
  }
124
142
  }
125
143
  function leaveDict() {
126
- if (state === 1 ) {
144
+ if (state === State.DICT_STATE) {
127
145
  popState();
128
146
  }
129
- else if (state === 2 ) {
147
+ else if (state === State.ARR_STATE) {
130
148
  return fail('unexpected </dict>');
131
149
  }
132
150
  else {
@@ -134,22 +152,22 @@ function _parse(content, filename, locationKeyName) {
134
152
  }
135
153
  }
136
154
  function enterArray() {
137
- if (state === 1 ) {
155
+ if (state === State.DICT_STATE) {
138
156
  dictState.enterArray();
139
157
  }
140
- else if (state === 2 ) {
158
+ else if (state === State.ARR_STATE) {
141
159
  arrState.enterArray();
142
160
  }
143
161
  else {
144
162
  cur = [];
145
- pushState(2 , cur);
163
+ pushState(State.ARR_STATE, cur);
146
164
  }
147
165
  }
148
166
  function leaveArray() {
149
- if (state === 1 ) {
167
+ if (state === State.DICT_STATE) {
150
168
  return fail('unexpected </array>');
151
169
  }
152
- else if (state === 2 ) {
170
+ else if (state === State.ARR_STATE) {
153
171
  popState();
154
172
  }
155
173
  else {
@@ -157,13 +175,13 @@ function _parse(content, filename, locationKeyName) {
157
175
  }
158
176
  }
159
177
  function acceptKey(val) {
160
- if (state === 1 ) {
178
+ if (state === State.DICT_STATE) {
161
179
  if (curKey !== null) {
162
180
  return fail('too many <key>');
163
181
  }
164
182
  curKey = val;
165
183
  }
166
- else if (state === 2 ) {
184
+ else if (state === State.ARR_STATE) {
167
185
  return fail('unexpected <key>');
168
186
  }
169
187
  else {
@@ -171,14 +189,14 @@ function _parse(content, filename, locationKeyName) {
171
189
  }
172
190
  }
173
191
  function acceptString(val) {
174
- if (state === 1 ) {
192
+ if (state === State.DICT_STATE) {
175
193
  if (curKey === null) {
176
194
  return fail('missing <key>');
177
195
  }
178
196
  cur[curKey] = val;
179
197
  curKey = null;
180
198
  }
181
- else if (state === 2 ) {
199
+ else if (state === State.ARR_STATE) {
182
200
  cur.push(val);
183
201
  }
184
202
  else {
@@ -189,14 +207,14 @@ function _parse(content, filename, locationKeyName) {
189
207
  if (isNaN(val)) {
190
208
  return fail('cannot parse float');
191
209
  }
192
- if (state === 1 ) {
210
+ if (state === State.DICT_STATE) {
193
211
  if (curKey === null) {
194
212
  return fail('missing <key>');
195
213
  }
196
214
  cur[curKey] = val;
197
215
  curKey = null;
198
216
  }
199
- else if (state === 2 ) {
217
+ else if (state === State.ARR_STATE) {
200
218
  cur.push(val);
201
219
  }
202
220
  else {
@@ -207,14 +225,14 @@ function _parse(content, filename, locationKeyName) {
207
225
  if (isNaN(val)) {
208
226
  return fail('cannot parse integer');
209
227
  }
210
- if (state === 1 ) {
228
+ if (state === State.DICT_STATE) {
211
229
  if (curKey === null) {
212
230
  return fail('missing <key>');
213
231
  }
214
232
  cur[curKey] = val;
215
233
  curKey = null;
216
234
  }
217
- else if (state === 2 ) {
235
+ else if (state === State.ARR_STATE) {
218
236
  cur.push(val);
219
237
  }
220
238
  else {
@@ -222,14 +240,14 @@ function _parse(content, filename, locationKeyName) {
222
240
  }
223
241
  }
224
242
  function acceptDate(val) {
225
- if (state === 1 ) {
243
+ if (state === State.DICT_STATE) {
226
244
  if (curKey === null) {
227
245
  return fail('missing <key>');
228
246
  }
229
247
  cur[curKey] = val;
230
248
  curKey = null;
231
249
  }
232
- else if (state === 2 ) {
250
+ else if (state === State.ARR_STATE) {
233
251
  cur.push(val);
234
252
  }
235
253
  else {
@@ -237,14 +255,14 @@ function _parse(content, filename, locationKeyName) {
237
255
  }
238
256
  }
239
257
  function acceptData(val) {
240
- if (state === 1 ) {
258
+ if (state === State.DICT_STATE) {
241
259
  if (curKey === null) {
242
260
  return fail('missing <key>');
243
261
  }
244
262
  cur[curKey] = val;
245
263
  curKey = null;
246
264
  }
247
- else if (state === 2 ) {
265
+ else if (state === State.ARR_STATE) {
248
266
  cur.push(val);
249
267
  }
250
268
  else {
@@ -252,14 +270,14 @@ function _parse(content, filename, locationKeyName) {
252
270
  }
253
271
  }
254
272
  function acceptBool(val) {
255
- if (state === 1 ) {
273
+ if (state === State.DICT_STATE) {
256
274
  if (curKey === null) {
257
275
  return fail('missing <key>');
258
276
  }
259
277
  cur[curKey] = val;
260
278
  curKey = null;
261
279
  }
262
- else if (state === 2 ) {
280
+ else if (state === State.ARR_STATE) {
263
281
  cur.push(val);
264
282
  }
265
283
  else {
@@ -285,7 +303,7 @@ function _parse(content, filename, locationKeyName) {
285
303
  function parseOpenTag() {
286
304
  let r = captureUntil('>');
287
305
  let isClosed = false;
288
- if (r.charCodeAt(r.length - 1) === 47 ) {
306
+ if (r.charCodeAt(r.length - 1) === ChCode.SLASH) {
289
307
  isClosed = true;
290
308
  r = r.substring(0, r.length - 1);
291
309
  }
@@ -309,19 +327,19 @@ function _parse(content, filename, locationKeyName) {
309
327
  }
310
328
  const chCode = content.charCodeAt(pos);
311
329
  advancePosBy(1);
312
- if (chCode !== 60 ) {
330
+ if (chCode !== ChCode.LESS_THAN) {
313
331
  return fail('expected <');
314
332
  }
315
333
  if (pos >= len) {
316
334
  return fail('unexpected end of input');
317
335
  }
318
336
  const peekChCode = content.charCodeAt(pos);
319
- if (peekChCode === 63 ) {
337
+ if (peekChCode === ChCode.QUESTION_MARK) {
320
338
  advancePosBy(1);
321
339
  advanceUntil('?>');
322
340
  continue;
323
341
  }
324
- if (peekChCode === 33 ) {
342
+ if (peekChCode === ChCode.EXCLAMATION_MARK) {
325
343
  advancePosBy(1);
326
344
  if (advanceIfStartsWith('--')) {
327
345
  advanceUntil('-->');
@@ -330,7 +348,7 @@ function _parse(content, filename, locationKeyName) {
330
348
  advanceUntil('>');
331
349
  continue;
332
350
  }
333
- if (peekChCode === 47 ) {
351
+ if (peekChCode === ChCode.SLASH) {
334
352
  advancePosBy(1);
335
353
  skipWhitespace();
336
354
  if (advanceIfStartsWith('plist')) {
@@ -1,7 +1,7 @@
1
1
  import { localizeWithPath } from 'vscode/vscode/vs/nls';
2
2
  import { isUndefined } from 'vscode/vscode/vs/base/common/types';
3
3
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
4
- import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
4
+ import { Extensions, ConfigurationScope } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
5
5
  import { textmateColorGroupSchemaId, textmateColorsSchemaId } from './colorThemeSchema.js';
6
6
  import { workbenchColorsSchemaId } from 'vscode/vscode/vs/platform/theme/common/colorUtils';
7
7
  import 'vscode/vscode/vs/platform/theme/common/colors/baseColors';
@@ -16,6 +16,7 @@ import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
16
16
  import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
17
17
  import { tokenStylingSchemaId } from 'vscode/vscode/vs/platform/theme/common/tokenClassificationRegistry';
18
18
  import { ThemeSettings, ThemeSettingDefaults } from 'vscode/vscode/vs/workbench/services/themes/common/workbenchThemeService';
19
+ import { ConfigurationTarget } from 'vscode/vscode/vs/platform/configuration/common/configuration';
19
20
  import { isWeb } from 'vscode/vscode/vs/base/common/platform';
20
21
  import { ColorScheme } from 'vscode/vscode/vs/platform/theme/common/theme';
21
22
 
@@ -156,7 +157,7 @@ const detectHCSchemeSettingSchema = {
156
157
  formatSettingAsLink(ThemeSettings.PREFERRED_HC_DARK_THEME),
157
158
  formatSettingAsLink(ThemeSettings.PREFERRED_HC_LIGHT_THEME)
158
159
  )),
159
- scope: 1 ,
160
+ scope: ConfigurationScope.APPLICATION,
160
161
  tags: [COLOR_THEME_CONFIGURATION_SETTINGS_TAG],
161
162
  };
162
163
  const themeSettingsConfiguration = {
@@ -366,6 +367,9 @@ class ThemeConfiguration {
366
367
  }
367
368
  return undefined;
368
369
  }
370
+ isDetectingColorScheme() {
371
+ return this.configurationService.getValue(ThemeSettings.DETECT_COLOR_SCHEME);
372
+ }
369
373
  getColorThemeSettingId() {
370
374
  const preferredScheme = this.getPreferredColorScheme();
371
375
  return preferredScheme ? colorSchemeToPreferred[preferredScheme] : ThemeSettings.COLOR_THEME;
@@ -389,15 +393,15 @@ class ThemeConfiguration {
389
393
  findAutoConfigurationTarget(key) {
390
394
  const settings = this.configurationService.inspect(key);
391
395
  if (!isUndefined(settings.workspaceFolderValue)) {
392
- return 6 ;
396
+ return ConfigurationTarget.WORKSPACE_FOLDER;
393
397
  }
394
398
  else if (!isUndefined(settings.workspaceValue)) {
395
- return 5 ;
399
+ return ConfigurationTarget.WORKSPACE;
396
400
  }
397
401
  else if (!isUndefined(settings.userRemote)) {
398
- return 4 ;
402
+ return ConfigurationTarget.USER_REMOTE;
399
403
  }
400
- return 2 ;
404
+ return ConfigurationTarget.USER;
401
405
  }
402
406
  async writeConfiguration(key, value, settingsTarget) {
403
407
  if (settingsTarget === undefined || settingsTarget === 'preview') {
@@ -407,7 +411,7 @@ class ThemeConfiguration {
407
411
  if (settingsTarget === 'auto') {
408
412
  return this.configurationService.updateValue(key, value);
409
413
  }
410
- if (settingsTarget === 2 ) {
414
+ if (settingsTarget === ConfigurationTarget.USER) {
411
415
  if (value === settings.userValue) {
412
416
  return Promise.resolve(undefined);
413
417
  }
@@ -418,7 +422,7 @@ class ThemeConfiguration {
418
422
  value = undefined;
419
423
  }
420
424
  }
421
- else if (settingsTarget === 5 || settingsTarget === 6 || settingsTarget === 4 ) {
425
+ else if (settingsTarget === ConfigurationTarget.WORKSPACE || settingsTarget === ConfigurationTarget.WORKSPACE_FOLDER || settingsTarget === ConfigurationTarget.USER_REMOTE) {
422
426
  if (value === settings.value) {
423
427
  return Promise.resolve(undefined);
424
428
  }