@codingame/monaco-vscode-configuration-service-override 9.0.2 → 10.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/configuration.js CHANGED
@@ -37,7 +37,10 @@ import { getService, withReadyServices } from 'vscode/services';
37
37
  import { unsupported, memoizedConstructor } from './tools.js';
38
38
  import { getWorkspaceIdentifier } from 'vscode/workbench';
39
39
 
40
- const defaultUserConfigurationFile = ( URI.from({ scheme: Schemas.vscodeUserData, path: '/User/settings.json' }));
40
+ const defaultUserConfigurationFile = ( URI.from({
41
+ scheme: Schemas.vscodeUserData,
42
+ path: '/User/settings.json'
43
+ }));
41
44
  async function initUserConfiguration(configurationJson, options, file = defaultUserConfigurationFile) {
42
45
  await initFile(file, configurationJson, options);
43
46
  }
@@ -52,9 +55,9 @@ async function getUserConfiguration() {
52
55
  return ( (await fileService.readFile(userDataProfilesService.defaultProfile.settingsResource)).value.toString());
53
56
  }
54
57
  function onUserConfigurationChange(callback) {
55
- return withReadyServices(accessor => {
58
+ return withReadyServices((accessor) => {
56
59
  const userDataProfilesService = accessor.get(IUserDataProfilesService);
57
- return accessor.get(IFileService).onDidFilesChange(e => {
60
+ return accessor.get(IFileService).onDidFilesChange((e) => {
58
61
  if (e.affects(userDataProfilesService.defaultProfile.settingsResource)) {
59
62
  callback();
60
63
  }
@@ -115,7 +118,7 @@ registerServiceInitializePreParticipant(async (accessor) => {
115
118
  });
116
119
  const MemoizedInjectedConfigurationService = memoizedConstructor(InjectedConfigurationService);
117
120
  async function reinitializeWorkspace(workspace) {
118
- const workspaceService = await getService(IWorkspaceContextService);
121
+ const workspaceService = (await getService(IWorkspaceContextService));
119
122
  await workspaceService.initialize(workspace);
120
123
  }
121
124
  function getServiceOverride(defaultWorkspace) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-configuration-service-override",
3
- "version": "9.0.2",
3
+ "version": "10.0.0",
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@9.0.2",
30
- "@codingame/monaco-vscode-files-service-override": "9.0.2"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@10.0.0",
30
+ "@codingame/monaco-vscode-files-service-override": "10.0.0"
31
31
  }
32
32
  }
package/tools.js CHANGED
@@ -18,7 +18,7 @@ function memoizedConstructor(ctor) {
18
18
  });
19
19
  }
20
20
  async function sleep(duration) {
21
- await new Promise(resolve => setTimeout(resolve, duration));
21
+ await new Promise((resolve) => setTimeout(resolve, duration));
22
22
  }
23
23
  function throttle(fct, merge, delay) {
24
24
  let lastPromise = Promise.resolve();
@@ -26,7 +26,9 @@ function throttle(fct, merge, delay) {
26
26
  return async (param) => {
27
27
  if (toConsume == null) {
28
28
  toConsume = param;
29
- lastPromise = lastPromise.then(async () => await sleep(delay)).then(async () => {
29
+ lastPromise = lastPromise
30
+ .then(async () => await sleep(delay))
31
+ .then(async () => {
30
32
  const _toConsume = toConsume;
31
33
  toConsume = null;
32
34
  await fct(_toConsume);
@@ -4,7 +4,6 @@ import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
4
  import { Position } from 'vscode/vscode/vs/editor/common/core/position';
5
5
  import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
6
6
  import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
7
- import { ConfigurationTarget } from 'vscode/vscode/vs/platform/configuration/common/configuration';
8
7
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
9
8
 
10
9
  let TextResourceConfigurationService = class TextResourceConfigurationService extends Disposable {
@@ -35,34 +34,34 @@ let TextResourceConfigurationService = class TextResourceConfigurationService ex
35
34
  deriveConfigurationTarget(configurationValue, language) {
36
35
  if (language) {
37
36
  if (configurationValue.memory?.override !== undefined) {
38
- return ConfigurationTarget.MEMORY;
37
+ return 8 ;
39
38
  }
40
39
  if (configurationValue.workspaceFolder?.override !== undefined) {
41
- return ConfigurationTarget.WORKSPACE_FOLDER;
40
+ return 6 ;
42
41
  }
43
42
  if (configurationValue.workspace?.override !== undefined) {
44
- return ConfigurationTarget.WORKSPACE;
43
+ return 5 ;
45
44
  }
46
45
  if (configurationValue.userRemote?.override !== undefined) {
47
- return ConfigurationTarget.USER_REMOTE;
46
+ return 4 ;
48
47
  }
49
48
  if (configurationValue.userLocal?.override !== undefined) {
50
- return ConfigurationTarget.USER_LOCAL;
49
+ return 3 ;
51
50
  }
52
51
  }
53
52
  if (configurationValue.memory?.value !== undefined) {
54
- return ConfigurationTarget.MEMORY;
53
+ return 8 ;
55
54
  }
56
55
  if (configurationValue.workspaceFolder?.value !== undefined) {
57
- return ConfigurationTarget.WORKSPACE_FOLDER;
56
+ return 6 ;
58
57
  }
59
58
  if (configurationValue.workspace?.value !== undefined) {
60
- return ConfigurationTarget.WORKSPACE;
59
+ return 5 ;
61
60
  }
62
61
  if (configurationValue.userRemote?.value !== undefined) {
63
- return ConfigurationTarget.USER_REMOTE;
62
+ return 4 ;
64
63
  }
65
- return ConfigurationTarget.USER_LOCAL;
64
+ return 3 ;
66
65
  }
67
66
  _getValue(resource, position, section) {
68
67
  const language = resource ? this.getLanguage(resource, position) : undefined;
@@ -2,7 +2,7 @@ import { localize } from 'vscode/vscode/vs/nls';
2
2
  import { deepClone } from 'vscode/vscode/vs/base/common/objects';
3
3
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
4
4
  import { ExtensionsRegistry } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
5
- import { Extensions as Extensions$1, configurationDefaultsSchemaId, ConfigurationScope, OVERRIDE_PROPERTY_REGEX, validateProperty, parseScope, getAllConfigurationProperties, getDefaultValue } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
5
+ import { Extensions as Extensions$1, configurationDefaultsSchemaId, OVERRIDE_PROPERTY_REGEX, validateProperty, parseScope, getAllConfigurationProperties, getDefaultValue } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
6
6
  import { Extensions } from 'vscode/vscode/vs/platform/jsonschemas/common/jsonContributionRegistry';
7
7
  import { workspaceSettingsSchemaId, launchSchemaId, tasksSchemaId } from 'vscode/vscode/vs/workbench/services/configuration/common/configuration';
8
8
  import { isObject, isUndefined } from 'vscode/vscode/vs/base/common/types';
@@ -20,29 +20,29 @@ const configurationEntrySchema = {
20
20
  properties: {
21
21
  title: {
22
22
  description: ( localize(
23
- 3601,
23
+ 3629,
24
24
  'A title for the current category of settings. This label will be rendered in the Settings editor as a subheading. If the title is the same as the extension display name, then the category will be grouped under the main extension heading.'
25
25
  )),
26
26
  type: 'string'
27
27
  },
28
28
  order: {
29
29
  description: ( localize(
30
- 3602,
30
+ 3630,
31
31
  'When specified, gives the order of this category of settings relative to other categories.'
32
32
  )),
33
33
  type: 'integer'
34
34
  },
35
35
  properties: {
36
- description: ( localize(3603, 'Description of the configuration properties.')),
36
+ description: ( localize(3631, 'Description of the configuration properties.')),
37
37
  type: 'object',
38
38
  propertyNames: {
39
39
  pattern: '\\S+',
40
- patternErrorMessage: ( localize(3604, 'Property should not be empty.')),
40
+ patternErrorMessage: ( localize(3632, 'Property should not be empty.')),
41
41
  },
42
42
  additionalProperties: {
43
43
  anyOf: [
44
44
  {
45
- title: ( localize(3605, 'Schema of the configuration property.')),
45
+ title: ( localize(3633, 'Schema of the configuration property.')),
46
46
  $ref: 'http://json-schema.org/draft-07/schema#'
47
47
  },
48
48
  {
@@ -53,30 +53,30 @@ const configurationEntrySchema = {
53
53
  enum: ['application', 'machine', 'window', 'resource', 'language-overridable', 'machine-overridable'],
54
54
  default: 'window',
55
55
  enumDescriptions: [
56
- ( localize(3606, "Configuration that can be configured only in the user settings.")),
56
+ ( localize(3634, "Configuration that can be configured only in the user settings.")),
57
57
  ( localize(
58
- 3607,
58
+ 3635,
59
59
  "Configuration that can be configured only in the user settings or only in the remote settings."
60
60
  )),
61
61
  ( localize(
62
- 3608,
62
+ 3636,
63
63
  "Configuration that can be configured in the user, remote or workspace settings."
64
64
  )),
65
65
  ( localize(
66
- 3609,
66
+ 3637,
67
67
  "Configuration that can be configured in the user, remote, workspace or folder settings."
68
68
  )),
69
69
  ( localize(
70
- 3610,
70
+ 3638,
71
71
  "Resource configuration that can be configured in language specific settings."
72
72
  )),
73
73
  ( localize(
74
- 3611,
74
+ 3639,
75
75
  "Machine configuration that can be configured also in workspace or folder settings."
76
76
  ))
77
77
  ],
78
78
  markdownDescription: ( localize(
79
- 3612,
79
+ 3640,
80
80
  "Scope in which the configuration is applicable. Available scopes are `application`, `machine`, `window`, `resource`, and `machine-overridable`."
81
81
  ))
82
82
  },
@@ -85,14 +85,14 @@ const configurationEntrySchema = {
85
85
  items: {
86
86
  type: 'string',
87
87
  },
88
- description: ( localize(3613, 'Descriptions for enum values'))
88
+ description: ( localize(3641, 'Descriptions for enum values'))
89
89
  },
90
90
  markdownEnumDescriptions: {
91
91
  type: 'array',
92
92
  items: {
93
93
  type: 'string',
94
94
  },
95
- description: ( localize(3614, 'Descriptions for enum values in the markdown format.'))
95
+ description: ( localize(3642, 'Descriptions for enum values in the markdown format.'))
96
96
  },
97
97
  enumItemLabels: {
98
98
  type: 'array',
@@ -100,26 +100,26 @@ const configurationEntrySchema = {
100
100
  type: 'string'
101
101
  },
102
102
  markdownDescription: ( localize(
103
- 3615,
103
+ 3643,
104
104
  'Labels for enum values to be displayed in the Settings editor. When specified, the {0} values still show after the labels, but less prominently.',
105
105
  '`enum`'
106
106
  ))
107
107
  },
108
108
  markdownDescription: {
109
109
  type: 'string',
110
- description: ( localize(3616, 'The description in the markdown format.'))
110
+ description: ( localize(3644, 'The description in the markdown format.'))
111
111
  },
112
112
  deprecationMessage: {
113
113
  type: 'string',
114
114
  description: ( localize(
115
- 3617,
115
+ 3645,
116
116
  'If set, the property is marked as deprecated and the given message is shown as an explanation.'
117
117
  ))
118
118
  },
119
119
  markdownDeprecationMessage: {
120
120
  type: 'string',
121
121
  description: ( localize(
122
- 3618,
122
+ 3646,
123
123
  'If set, the property is marked as deprecated and the given message is shown as an explanation in the markdown format.'
124
124
  ))
125
125
  },
@@ -127,26 +127,26 @@ const configurationEntrySchema = {
127
127
  type: 'string',
128
128
  enum: ['singlelineText', 'multilineText'],
129
129
  enumDescriptions: [
130
- ( localize(3619, 'The value will be shown in an inputbox.')),
131
- ( localize(3620, 'The value will be shown in a textarea.'))
130
+ ( localize(3647, 'The value will be shown in an inputbox.')),
131
+ ( localize(3648, 'The value will be shown in a textarea.'))
132
132
  ],
133
133
  default: 'singlelineText',
134
134
  description: ( localize(
135
- 3621,
135
+ 3649,
136
136
  'When specified, controls the presentation format of the string setting.'
137
137
  ))
138
138
  },
139
139
  order: {
140
140
  type: 'integer',
141
141
  description: ( localize(
142
- 3622,
142
+ 3650,
143
143
  'When specified, gives the order of this setting relative to other settings within the same category. Settings with an order property will be placed before settings without this property set.'
144
144
  ))
145
145
  },
146
146
  ignoreSync: {
147
147
  type: 'boolean',
148
148
  description: ( localize(
149
- 3623,
149
+ 3651,
150
150
  'When enabled, Settings Sync will not sync the user value of this configuration by default.'
151
151
  ))
152
152
  },
@@ -183,14 +183,14 @@ defaultConfigurationExtPoint.setHandler((extensions, { added, removed }) => {
183
183
  }
184
184
  if (added.length) {
185
185
  const registeredProperties = configurationRegistry.getConfigurationProperties();
186
- const allowedScopes = [ConfigurationScope.MACHINE_OVERRIDABLE, ConfigurationScope.WINDOW, ConfigurationScope.RESOURCE, ConfigurationScope.LANGUAGE_OVERRIDABLE];
186
+ const allowedScopes = [6 , 3 , 4 , 5 ];
187
187
  const addedDefaultConfigurations = ( (added.map(extension => {
188
188
  const overrides = deepClone(extension.value);
189
189
  for (const key of ( (Object.keys(overrides)))) {
190
190
  const registeredPropertyScheme = registeredProperties[key];
191
191
  if (registeredPropertyScheme?.disallowConfigurationDefault) {
192
192
  extension.collector.warn(( localize(
193
- 3624,
193
+ 3652,
194
194
  "Cannot register configuration defaults for '{0}'. This setting does not allow contributing configuration defaults.",
195
195
  key
196
196
  )));
@@ -200,7 +200,7 @@ defaultConfigurationExtPoint.setHandler((extensions, { added, removed }) => {
200
200
  if (!OVERRIDE_PROPERTY_REGEX.test(key)) {
201
201
  if (registeredPropertyScheme?.scope && !allowedScopes.includes(registeredPropertyScheme.scope)) {
202
202
  extension.collector.warn(( localize(
203
- 3625,
203
+ 3653,
204
204
  "Cannot register configuration defaults for '{0}'. Only defaults for machine-overridable, window, resource and language overridable scoped settings are supported.",
205
205
  key
206
206
  )));
@@ -218,7 +218,7 @@ const configurationExtPoint = ExtensionsRegistry.registerExtensionPoint({
218
218
  extensionPoint: 'configuration',
219
219
  deps: [defaultConfigurationExtPoint],
220
220
  jsonSchema: {
221
- description: ( localize(3626, 'Contributes configuration settings.')),
221
+ description: ( localize(3654, 'Contributes configuration settings.')),
222
222
  oneOf: [
223
223
  configurationEntrySchema,
224
224
  {
@@ -243,7 +243,7 @@ configurationExtPoint.setHandler((extensions, { added, removed }) => {
243
243
  function handleConfiguration(node, extension) {
244
244
  const configuration = deepClone(node);
245
245
  if (configuration.title && (typeof configuration.title !== 'string')) {
246
- extension.collector.error(( localize(3627, "'configuration.title' must be a string")));
246
+ extension.collector.error(( localize(3655, "'configuration.title' must be a string")));
247
247
  }
248
248
  validateProperties(configuration, extension);
249
249
  configuration.id = node.id || extension.description.identifier.value;
@@ -256,7 +256,7 @@ configurationExtPoint.setHandler((extensions, { added, removed }) => {
256
256
  const properties = configuration.properties;
257
257
  if (properties) {
258
258
  if (typeof properties !== 'object') {
259
- extension.collector.error(( localize(3628, "'configuration.properties' must be an object")));
259
+ extension.collector.error(( localize(3656, "'configuration.properties' must be an object")));
260
260
  configuration.properties = {};
261
261
  }
262
262
  for (const key in properties) {
@@ -269,22 +269,22 @@ configurationExtPoint.setHandler((extensions, { added, removed }) => {
269
269
  }
270
270
  if (( (seenProperties.has(key)))) {
271
271
  delete properties[key];
272
- extension.collector.warn(( localize(3629, "Cannot register '{0}'. This property is already registered.", key)));
272
+ extension.collector.warn(( localize(3657, "Cannot register '{0}'. This property is already registered.", key)));
273
273
  continue;
274
274
  }
275
275
  if (!isObject(propertyConfiguration)) {
276
276
  delete properties[key];
277
- extension.collector.error(( localize(3630, "configuration.properties property '{0}' must be an object", key)));
277
+ extension.collector.error(( localize(3658, "configuration.properties property '{0}' must be an object", key)));
278
278
  continue;
279
279
  }
280
280
  seenProperties.add(key);
281
- propertyConfiguration.scope = propertyConfiguration.scope ? parseScope(( (propertyConfiguration.scope.toString()))) : ConfigurationScope.WINDOW;
281
+ propertyConfiguration.scope = propertyConfiguration.scope ? parseScope(( (propertyConfiguration.scope.toString()))) : 3 ;
282
282
  }
283
283
  }
284
284
  const subNodes = configuration.allOf;
285
285
  if (subNodes) {
286
286
  extension.collector.error(( localize(
287
- 3631,
287
+ 3659,
288
288
  "'configuration.allOf' is deprecated and should no longer be used. Instead, pass multiple configuration sections as an array to the 'configuration' contribution point."
289
289
  )));
290
290
  for (const node of subNodes) {
@@ -327,7 +327,7 @@ jsonRegistry.registerSchema('vscode://schemas/workspaceConfig', {
327
327
  'folders': {
328
328
  minItems: 0,
329
329
  uniqueItems: true,
330
- description: ( localize(3632, "List of folders to be loaded in the workspace.")),
330
+ description: ( localize(3660, "List of folders to be loaded in the workspace.")),
331
331
  items: {
332
332
  type: 'object',
333
333
  defaultSnippets: [{ body: { path: '$1' } }],
@@ -336,13 +336,13 @@ jsonRegistry.registerSchema('vscode://schemas/workspaceConfig', {
336
336
  path: {
337
337
  type: 'string',
338
338
  description: ( localize(
339
- 3633,
339
+ 3661,
340
340
  "A file path. e.g. `/root/folderA` or `./folderA` for a relative path that will be resolved against the location of the workspace file."
341
341
  ))
342
342
  },
343
343
  name: {
344
344
  type: 'string',
345
- description: ( localize(3634, "An optional name for the folder. "))
345
+ description: ( localize(3662, "An optional name for the folder. "))
346
346
  }
347
347
  },
348
348
  required: ['path']
@@ -350,11 +350,11 @@ jsonRegistry.registerSchema('vscode://schemas/workspaceConfig', {
350
350
  properties: {
351
351
  uri: {
352
352
  type: 'string',
353
- description: ( localize(3635, "URI of the folder"))
353
+ description: ( localize(3663, "URI of the folder"))
354
354
  },
355
355
  name: {
356
356
  type: 'string',
357
- description: ( localize(3634, "An optional name for the folder. "))
357
+ description: ( localize(3662, "An optional name for the folder. "))
358
358
  }
359
359
  },
360
360
  required: ['uri']
@@ -364,39 +364,39 @@ jsonRegistry.registerSchema('vscode://schemas/workspaceConfig', {
364
364
  'settings': {
365
365
  type: 'object',
366
366
  default: {},
367
- description: ( localize(3636, "Workspace settings")),
367
+ description: ( localize(3664, "Workspace settings")),
368
368
  $ref: workspaceSettingsSchemaId
369
369
  },
370
370
  'launch': {
371
371
  type: 'object',
372
372
  default: { configurations: [], compounds: [] },
373
- description: ( localize(3637, "Workspace launch configurations")),
373
+ description: ( localize(3665, "Workspace launch configurations")),
374
374
  $ref: launchSchemaId
375
375
  },
376
376
  'tasks': {
377
377
  type: 'object',
378
378
  default: { version: '2.0.0', tasks: [] },
379
- description: ( localize(3638, "Workspace task configurations")),
379
+ description: ( localize(3666, "Workspace task configurations")),
380
380
  $ref: tasksSchemaId
381
381
  },
382
382
  'extensions': {
383
383
  type: 'object',
384
384
  default: {},
385
- description: ( localize(3639, "Workspace extensions")),
385
+ description: ( localize(3667, "Workspace extensions")),
386
386
  $ref: 'vscode://schemas/extensions'
387
387
  },
388
388
  'remoteAuthority': {
389
389
  type: 'string',
390
390
  doNotSuggest: true,
391
- description: ( localize(3640, "The remote server where the workspace is located.")),
391
+ description: ( localize(3668, "The remote server where the workspace is located.")),
392
392
  },
393
393
  'transient': {
394
394
  type: 'boolean',
395
395
  doNotSuggest: true,
396
- description: ( localize(3641, "A transient workspace will disappear when restarting or reloading.")),
396
+ description: ( localize(3669, "A transient workspace will disappear when restarting or reloading.")),
397
397
  }
398
398
  },
399
- errorMessage: ( localize(3642, "Unknown workspace configuration property"))
399
+ errorMessage: ( localize(3670, "Unknown workspace configuration property"))
400
400
  });
401
401
  class SettingsTableRenderer extends Disposable {
402
402
  constructor() {
@@ -412,7 +412,7 @@ class SettingsTableRenderer extends Disposable {
412
412
  : [];
413
413
  const properties = getAllConfigurationProperties(configuration);
414
414
  const contrib = properties ? ( (Object.keys(properties))) : [];
415
- const headers = [( localize(3643, "ID")), ( localize(3644, "Description")), ( localize(3645, "Default"))];
415
+ const headers = [( localize(3671, "ID")), ( localize(3672, "Description")), ( localize(3673, "Default"))];
416
416
  const rows = ( (contrib.sort((a, b) => a.localeCompare(b))
417
417
  .map(key => {
418
418
  return [
@@ -432,7 +432,7 @@ class SettingsTableRenderer extends Disposable {
432
432
  }
433
433
  ( (Registry.as(Extensions$2.ExtensionFeaturesRegistry))).registerExtensionFeature({
434
434
  id: 'configuration',
435
- label: ( localize(3646, "Settings")),
435
+ label: ( localize(3674, "Settings")),
436
436
  access: {
437
437
  canToggle: false
438
438
  },
@@ -2,8 +2,7 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { localize, localize2 } from 'vscode/vscode/vs/nls';
3
3
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
4
4
  import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
5
- import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
6
- import { WorkbenchState, hasWorkspaceFileExtension, WORKSPACE_SUFFIX } from 'vscode/vscode/vs/platform/workspace/common/workspace';
5
+ import { hasWorkspaceFileExtension, WORKSPACE_SUFFIX } from 'vscode/vscode/vs/platform/workspace/common/workspace';
7
6
  import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
8
7
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
9
8
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
@@ -12,7 +11,6 @@ import { INotificationService } from 'vscode/vscode/vs/platform/notification/com
12
11
  import { joinPath, isEqual } from 'vscode/vscode/vs/base/common/resources';
13
12
  import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host.service';
14
13
  import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
15
- import { StorageScope } from 'vscode/vscode/vs/platform/storage/common/storage';
16
14
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
17
15
  import { isVirtualWorkspace } from 'vscode/vscode/vs/platform/workspace/common/virtualWorkspace';
18
16
  import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
@@ -34,7 +32,7 @@ let WorkspacesFinderContribution = class WorkspacesFinderContribution extends Di
34
32
  }
35
33
  async findWorkspaces() {
36
34
  const folder = this.contextService.getWorkspace().folders[0];
37
- if (!folder || this.contextService.getWorkbenchState() !== WorkbenchState.FOLDER || isVirtualWorkspace(this.contextService.getWorkspace())) {
35
+ if (!folder || this.contextService.getWorkbenchState() !== 2 || isVirtualWorkspace(this.contextService.getWorkspace())) {
38
36
  return;
39
37
  }
40
38
  const rootFileNames = (await this.fileService.resolve(folder.uri)).children?.map(child => child.name);
@@ -50,27 +48,27 @@ let WorkspacesFinderContribution = class WorkspacesFinderContribution extends Di
50
48
  if (workspaces.length === 1) {
51
49
  const workspaceFile = workspaces[0];
52
50
  this.notificationService.prompt(Severity$1.Info, ( localize(
53
- 3647,
51
+ 3675,
54
52
  "This folder contains a workspace file '{0}'. Do you want to open it? [Learn more]({1}) about workspace files.",
55
53
  workspaceFile,
56
54
  'https://go.microsoft.com/fwlink/?linkid=2025315'
57
55
  )), [{
58
- label: ( localize(3648, "Open Workspace")),
56
+ label: ( localize(3676, "Open Workspace")),
59
57
  run: () => this.hostService.openWindow([{ workspaceUri: joinPath(folder, workspaceFile) }])
60
58
  }], {
61
59
  neverShowAgain,
62
- priority: !this.storageService.isNew(StorageScope.WORKSPACE) ? NotificationPriority.SILENT : undefined
60
+ priority: !this.storageService.isNew(1 ) ? NotificationPriority.SILENT : undefined
63
61
  });
64
62
  }
65
63
  else if (workspaces.length > 1) {
66
64
  this.notificationService.prompt(Severity$1.Info, ( localize(
67
- 3649,
65
+ 3677,
68
66
  "This folder contains multiple workspace files. Do you want to open one? [Learn more]({0}) about workspace files.",
69
67
  'https://go.microsoft.com/fwlink/?linkid=2025315'
70
68
  )), [{
71
- label: ( localize(3650, "Select Workspace")),
69
+ label: ( localize(3678, "Select Workspace")),
72
70
  run: () => {
73
- this.quickInputService.pick(( (workspaces.map(workspace => ({ label: workspace })))), { placeHolder: ( localize(3651, "Select a workspace to open")) }).then(pick => {
71
+ this.quickInputService.pick(( (workspaces.map(workspace => ({ label: workspace })))), { placeHolder: ( localize(3679, "Select a workspace to open")) }).then(pick => {
74
72
  if (pick) {
75
73
  this.hostService.openWindow([{ workspaceUri: joinPath(folder, pick.label) }]);
76
74
  }
@@ -78,7 +76,7 @@ let WorkspacesFinderContribution = class WorkspacesFinderContribution extends Di
78
76
  }
79
77
  }], {
80
78
  neverShowAgain,
81
- priority: !this.storageService.isNew(StorageScope.WORKSPACE) ? NotificationPriority.SILENT : undefined
79
+ priority: !this.storageService.isNew(1 ) ? NotificationPriority.SILENT : undefined
82
80
  });
83
81
  }
84
82
  }
@@ -91,12 +89,12 @@ WorkspacesFinderContribution = ( (__decorate([
91
89
  ( (__param(4, IHostService))),
92
90
  ( (__param(5, IStorageService)))
93
91
  ], WorkspacesFinderContribution)));
94
- ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(WorkspacesFinderContribution, LifecyclePhase.Eventually);
92
+ ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(WorkspacesFinderContribution, 4 );
95
93
  registerAction2(class extends Action2 {
96
94
  constructor() {
97
95
  super({
98
96
  id: 'workbench.action.openWorkspaceFromEditor',
99
- title: ( localize2(3648, "Open Workspace")),
97
+ title: ( localize2(3676, "Open Workspace")),
100
98
  f1: false,
101
99
  menu: {
102
100
  id: MenuId.EditorContent,
@@ -112,10 +110,10 @@ registerAction2(class extends Action2 {
112
110
  const hostService = accessor.get(IHostService);
113
111
  const contextService = accessor.get(IWorkspaceContextService);
114
112
  const notificationService = accessor.get(INotificationService);
115
- if (contextService.getWorkbenchState() === WorkbenchState.WORKSPACE) {
113
+ if (contextService.getWorkbenchState() === 3 ) {
116
114
  const workspaceConfiguration = contextService.getWorkspace().configuration;
117
115
  if (workspaceConfiguration && isEqual(workspaceConfiguration, uri)) {
118
- notificationService.info(( localize(3652, "This workspace is already open.")));
116
+ notificationService.info(( localize(3680, "This workspace is already open.")));
119
117
  return;
120
118
  }
121
119
  }