@codingame/monaco-vscode-configuration-service-override 9.0.3 → 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.
@@ -4,15 +4,13 @@ import { parse } from 'vscode/vscode/vs/base/common/json';
4
4
  import { setProperty } from 'vscode/vscode/vs/base/common/jsonEdit';
5
5
  import { Queue } from 'vscode/vscode/vs/base/common/async';
6
6
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
7
- import { WorkbenchState } from 'vscode/vscode/vs/platform/workspace/common/workspace';
8
7
  import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
9
8
  import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles.service';
10
9
  import { TASKS_CONFIGURATION_KEY, LAUNCH_CONFIGURATION_KEY, TASKS_DEFAULT, FOLDER_SCOPES, USER_STANDALONE_CONFIGURATIONS, WORKSPACE_STANDALONE_CONFIGURATIONS, FOLDER_SETTINGS_PATH } from 'vscode/vscode/vs/workbench/services/configuration/common/configuration';
11
10
  import { IWorkbenchConfigurationService } from 'vscode/vscode/vs/workbench/services/configuration/common/configuration.service';
12
- import { FileOperationResult } from 'vscode/vscode/vs/platform/files/common/files';
13
11
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
14
12
  import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
15
- import { Extensions, OVERRIDE_PROPERTY_REGEX, ConfigurationScope, keyFromOverrideIdentifiers } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
13
+ import { Extensions, OVERRIDE_PROPERTY_REGEX, keyFromOverrideIdentifiers } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
16
14
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
17
15
  import 'vscode/vscode/vs/platform/notification/common/notification';
18
16
  import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
@@ -26,36 +24,12 @@ import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProf
26
24
  import { ErrorNoTelemetry } from 'vscode/vscode/vs/base/common/errors';
27
25
  import Severity$1 from 'vscode/vscode/vs/base/common/severity';
28
26
 
29
- var ConfigurationEditingErrorCode;
30
- ( ((function(ConfigurationEditingErrorCode) {
31
- ConfigurationEditingErrorCode[ConfigurationEditingErrorCode["ERROR_UNKNOWN_KEY"] = 0] = "ERROR_UNKNOWN_KEY";
32
- ConfigurationEditingErrorCode[ConfigurationEditingErrorCode["ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION"] = 1] = "ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION";
33
- ConfigurationEditingErrorCode[ConfigurationEditingErrorCode["ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE"] = 2] = "ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE";
34
- ConfigurationEditingErrorCode[ConfigurationEditingErrorCode["ERROR_INVALID_FOLDER_CONFIGURATION"] = 3] = "ERROR_INVALID_FOLDER_CONFIGURATION";
35
- ConfigurationEditingErrorCode[ConfigurationEditingErrorCode["ERROR_INVALID_USER_TARGET"] = 4] = "ERROR_INVALID_USER_TARGET";
36
- ConfigurationEditingErrorCode[ConfigurationEditingErrorCode["ERROR_INVALID_WORKSPACE_TARGET"] = 5] = "ERROR_INVALID_WORKSPACE_TARGET";
37
- ConfigurationEditingErrorCode[ConfigurationEditingErrorCode["ERROR_INVALID_FOLDER_TARGET"] = 6] = "ERROR_INVALID_FOLDER_TARGET";
38
- ConfigurationEditingErrorCode[ConfigurationEditingErrorCode["ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION"] = 7] = "ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION";
39
- ConfigurationEditingErrorCode[ConfigurationEditingErrorCode["ERROR_NO_WORKSPACE_OPENED"] = 8] = "ERROR_NO_WORKSPACE_OPENED";
40
- ConfigurationEditingErrorCode[ConfigurationEditingErrorCode["ERROR_CONFIGURATION_FILE_DIRTY"] = 9] = "ERROR_CONFIGURATION_FILE_DIRTY";
41
- ConfigurationEditingErrorCode[ConfigurationEditingErrorCode["ERROR_CONFIGURATION_FILE_MODIFIED_SINCE"] = 10] = "ERROR_CONFIGURATION_FILE_MODIFIED_SINCE";
42
- ConfigurationEditingErrorCode[ConfigurationEditingErrorCode["ERROR_INVALID_CONFIGURATION"] = 11] = "ERROR_INVALID_CONFIGURATION";
43
- ConfigurationEditingErrorCode[ConfigurationEditingErrorCode["ERROR_POLICY_CONFIGURATION"] = 12] = "ERROR_POLICY_CONFIGURATION";
44
- ConfigurationEditingErrorCode[ConfigurationEditingErrorCode["ERROR_INTERNAL"] = 13] = "ERROR_INTERNAL";
45
- })(ConfigurationEditingErrorCode || (ConfigurationEditingErrorCode = {}))));
46
27
  class ConfigurationEditingError extends ErrorNoTelemetry {
47
28
  constructor(message, code) {
48
29
  super(message);
49
30
  this.code = code;
50
31
  }
51
32
  }
52
- var EditableConfigurationTarget;
53
- ( ((function(EditableConfigurationTarget) {
54
- EditableConfigurationTarget[EditableConfigurationTarget["USER_LOCAL"] = 1] = "USER_LOCAL";
55
- EditableConfigurationTarget[EditableConfigurationTarget["USER_REMOTE"] = 2] = "USER_REMOTE";
56
- EditableConfigurationTarget[EditableConfigurationTarget["WORKSPACE"] = 3] = "WORKSPACE";
57
- EditableConfigurationTarget[EditableConfigurationTarget["WORKSPACE_FOLDER"] = 4] = "WORKSPACE_FOLDER";
58
- })(EditableConfigurationTarget || (EditableConfigurationTarget = {}))));
59
33
  let ConfigurationEditing = class ConfigurationEditing {
60
34
  constructor(remoteSettingsResource, configurationService, contextService, userDataProfileService, userDataProfilesService, fileService, textModelResolverService, textFileService, notificationService, preferencesService, editorService, uriIdentityService) {
61
35
  this.remoteSettingsResource = remoteSettingsResource;
@@ -100,7 +74,7 @@ let ConfigurationEditing = class ConfigurationEditing {
100
74
  }
101
75
  async updateConfiguration(operation, model, formattingOptions, options) {
102
76
  if (this.hasParseErrors(model.getValue(), operation)) {
103
- throw this.toConfigurationEditingError(ConfigurationEditingErrorCode.ERROR_INVALID_CONFIGURATION, operation.target, operation);
77
+ throw this.toConfigurationEditingError(11 , operation.target, operation);
104
78
  }
105
79
  if (this.textFileService.isDirty(model.uri) && options.handleDirtyFile) {
106
80
  switch (options.handleDirtyFile) {
@@ -122,15 +96,15 @@ let ConfigurationEditing = class ConfigurationEditing {
122
96
  await this.textFileService.save(model.uri, { ignoreErrorHandler: true });
123
97
  }
124
98
  catch (error) {
125
- if (error.fileOperationResult === FileOperationResult.FILE_MODIFIED_SINCE) {
126
- throw this.toConfigurationEditingError(ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE, operation.target, operation);
99
+ if (error.fileOperationResult === 3 ) {
100
+ throw this.toConfigurationEditingError(10 , operation.target, operation);
127
101
  }
128
102
  throw ( (new ConfigurationEditingError(localize(
129
- 8800,
103
+ 8861,
130
104
  "Error while writing to {0}. {1}",
131
105
  this.stringifyTarget(operation.target),
132
106
  error.message
133
- ), ConfigurationEditingErrorCode.ERROR_INTERNAL)));
107
+ ), 13 )));
134
108
  }
135
109
  }
136
110
  applyEditsToBuffer(edit, model) {
@@ -173,21 +147,21 @@ let ConfigurationEditing = class ConfigurationEditing {
173
147
  }
174
148
  async onError(error, operation, scopes) {
175
149
  switch (error.code) {
176
- case ConfigurationEditingErrorCode.ERROR_INVALID_CONFIGURATION:
150
+ case 11 :
177
151
  this.onInvalidConfigurationError(error, operation);
178
152
  break;
179
- case ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY:
153
+ case 9 :
180
154
  this.onConfigurationFileDirtyError(error, operation, scopes);
181
155
  break;
182
- case ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE:
156
+ case 10 :
183
157
  return this.doWriteConfiguration(operation, { scopes, handleDirtyFile: 'revert' });
184
158
  default:
185
159
  this.notificationService.error(error.message);
186
160
  }
187
161
  }
188
162
  onInvalidConfigurationError(error, operation) {
189
- const openStandAloneConfigurationActionLabel = operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY ? ( localize(8801, "Open Tasks Configuration"))
190
- : operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY ? ( localize(8802, "Open Launch Configuration"))
163
+ const openStandAloneConfigurationActionLabel = operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY ? ( localize(8862, "Open Tasks Configuration"))
164
+ : operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY ? ( localize(8863, "Open Launch Configuration"))
191
165
  : null;
192
166
  if (openStandAloneConfigurationActionLabel) {
193
167
  this.notificationService.prompt(Severity$1.Error, error.message, [{
@@ -197,18 +171,18 @@ let ConfigurationEditing = class ConfigurationEditing {
197
171
  }
198
172
  else {
199
173
  this.notificationService.prompt(Severity$1.Error, error.message, [{
200
- label: ( localize(8803, "Open Settings")),
174
+ label: ( localize(8864, "Open Settings")),
201
175
  run: () => this.openSettings(operation)
202
176
  }]);
203
177
  }
204
178
  }
205
179
  onConfigurationFileDirtyError(error, operation, scopes) {
206
- const openStandAloneConfigurationActionLabel = operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY ? ( localize(8801, "Open Tasks Configuration"))
207
- : operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY ? ( localize(8802, "Open Launch Configuration"))
180
+ const openStandAloneConfigurationActionLabel = operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY ? ( localize(8862, "Open Tasks Configuration"))
181
+ : operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY ? ( localize(8863, "Open Launch Configuration"))
208
182
  : null;
209
183
  if (openStandAloneConfigurationActionLabel) {
210
184
  this.notificationService.prompt(Severity$1.Error, error.message, [{
211
- label: ( localize(8804, "Save and Retry")),
185
+ label: ( localize(8865, "Save and Retry")),
212
186
  run: () => {
213
187
  const key = operation.key ? `${operation.workspaceStandAloneConfigurationKey}.${operation.key}` : operation.workspaceStandAloneConfigurationKey;
214
188
  this.writeConfiguration(operation.target, { key, value: operation.value }, { handleDirtyFile: 'save', scopes });
@@ -221,11 +195,11 @@ let ConfigurationEditing = class ConfigurationEditing {
221
195
  }
222
196
  else {
223
197
  this.notificationService.prompt(Severity$1.Error, error.message, [{
224
- label: ( localize(8804, "Save and Retry")),
198
+ label: ( localize(8865, "Save and Retry")),
225
199
  run: () => this.writeConfiguration(operation.target, { key: operation.key, value: operation.value }, { handleDirtyFile: 'save', scopes })
226
200
  },
227
201
  {
228
- label: ( localize(8803, "Open Settings")),
202
+ label: ( localize(8864, "Open Settings")),
229
203
  run: () => this.openSettings(operation)
230
204
  }]);
231
205
  }
@@ -233,16 +207,16 @@ let ConfigurationEditing = class ConfigurationEditing {
233
207
  openSettings(operation) {
234
208
  const options = { jsonEditor: true };
235
209
  switch (operation.target) {
236
- case EditableConfigurationTarget.USER_LOCAL:
210
+ case 1 :
237
211
  this.preferencesService.openUserSettings(options);
238
212
  break;
239
- case EditableConfigurationTarget.USER_REMOTE:
213
+ case 2 :
240
214
  this.preferencesService.openRemoteSettings(options);
241
215
  break;
242
- case EditableConfigurationTarget.WORKSPACE:
216
+ case 3 :
243
217
  this.preferencesService.openWorkspaceSettings(options);
244
218
  break;
245
- case EditableConfigurationTarget.WORKSPACE_FOLDER:
219
+ case 4 :
246
220
  if (operation.resource) {
247
221
  const workspaceFolder = this.contextService.getWorkspaceFolder(operation.resource);
248
222
  if (workspaceFolder) {
@@ -263,86 +237,86 @@ let ConfigurationEditing = class ConfigurationEditing {
263
237
  }
264
238
  toErrorMessage(error, target, operation) {
265
239
  switch (error) {
266
- case ConfigurationEditingErrorCode.ERROR_POLICY_CONFIGURATION: return ( localize(
267
- 8805,
240
+ case 12 : return ( localize(
241
+ 8866,
268
242
  "Unable to write {0} because it is configured in system policy.",
269
243
  operation.key
270
244
  ));
271
- case ConfigurationEditingErrorCode.ERROR_UNKNOWN_KEY: return ( localize(
272
- 8806,
245
+ case 0 : return ( localize(
246
+ 8867,
273
247
  "Unable to write to {0} because {1} is not a registered configuration.",
274
248
  this.stringifyTarget(target),
275
249
  operation.key
276
250
  ));
277
- case ConfigurationEditingErrorCode.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION: return ( localize(
278
- 8807,
251
+ case 1 : return ( localize(
252
+ 8868,
279
253
  "Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",
280
254
  operation.key
281
255
  ));
282
- case ConfigurationEditingErrorCode.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE: return ( localize(
283
- 8808,
256
+ case 2 : return ( localize(
257
+ 8869,
284
258
  "Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",
285
259
  operation.key
286
260
  ));
287
- case ConfigurationEditingErrorCode.ERROR_INVALID_FOLDER_CONFIGURATION: return ( localize(
288
- 8809,
261
+ case 3 : return ( localize(
262
+ 8870,
289
263
  "Unable to write to Folder Settings because {0} does not support the folder resource scope.",
290
264
  operation.key
291
265
  ));
292
- case ConfigurationEditingErrorCode.ERROR_INVALID_USER_TARGET: return ( localize(
293
- 8810,
266
+ case 4 : return ( localize(
267
+ 8871,
294
268
  "Unable to write to User Settings because {0} does not support for global scope.",
295
269
  operation.key
296
270
  ));
297
- case ConfigurationEditingErrorCode.ERROR_INVALID_WORKSPACE_TARGET: return ( localize(
298
- 8811,
271
+ case 5 : return ( localize(
272
+ 8872,
299
273
  "Unable to write to Workspace Settings because {0} does not support for workspace scope in a multi folder workspace.",
300
274
  operation.key
301
275
  ));
302
- case ConfigurationEditingErrorCode.ERROR_INVALID_FOLDER_TARGET: return ( localize(
303
- 8812,
276
+ case 6 : return ( localize(
277
+ 8873,
304
278
  "Unable to write to Folder Settings because no resource is provided."
305
279
  ));
306
- case ConfigurationEditingErrorCode.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION: return ( localize(
307
- 8813,
280
+ case 7 : return ( localize(
281
+ 8874,
308
282
  "Unable to write to Language Settings because {0} is not a resource language setting.",
309
283
  operation.key
310
284
  ));
311
- case ConfigurationEditingErrorCode.ERROR_NO_WORKSPACE_OPENED: return ( localize(
312
- 8814,
285
+ case 8 : return ( localize(
286
+ 8875,
313
287
  "Unable to write to {0} because no workspace is opened. Please open a workspace first and try again.",
314
288
  this.stringifyTarget(target)
315
289
  ));
316
- case ConfigurationEditingErrorCode.ERROR_INVALID_CONFIGURATION: {
290
+ case 11 : {
317
291
  if (operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY) {
318
292
  return ( localize(
319
- 8815,
293
+ 8876,
320
294
  "Unable to write into the tasks configuration file. Please open it to correct errors/warnings in it and try again."
321
295
  ));
322
296
  }
323
297
  if (operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY) {
324
298
  return ( localize(
325
- 8816,
299
+ 8877,
326
300
  "Unable to write into the launch configuration file. Please open it to correct errors/warnings in it and try again."
327
301
  ));
328
302
  }
329
303
  switch (target) {
330
- case EditableConfigurationTarget.USER_LOCAL:
304
+ case 1 :
331
305
  return ( localize(
332
- 8817,
306
+ 8878,
333
307
  "Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again."
334
308
  ));
335
- case EditableConfigurationTarget.USER_REMOTE:
309
+ case 2 :
336
310
  return ( localize(
337
- 8818,
311
+ 8879,
338
312
  "Unable to write into remote user settings. Please open the remote user settings to correct errors/warnings in it and try again."
339
313
  ));
340
- case EditableConfigurationTarget.WORKSPACE:
314
+ case 3 :
341
315
  return ( localize(
342
- 8819,
316
+ 8880,
343
317
  "Unable to write into workspace settings. Please open the workspace settings to correct errors/warnings in the file and try again."
344
318
  ));
345
- case EditableConfigurationTarget.WORKSPACE_FOLDER: {
319
+ case 4 : {
346
320
  let workspaceFolderName = '<<unknown>>';
347
321
  if (operation.resource) {
348
322
  const folder = this.contextService.getWorkspaceFolder(operation.resource);
@@ -351,7 +325,7 @@ let ConfigurationEditing = class ConfigurationEditing {
351
325
  }
352
326
  }
353
327
  return ( localize(
354
- 8820,
328
+ 8881,
355
329
  "Unable to write into folder settings. Please open the '{0}' folder settings to correct errors/warnings in it and try again.",
356
330
  workspaceFolderName
357
331
  ));
@@ -360,36 +334,36 @@ let ConfigurationEditing = class ConfigurationEditing {
360
334
  return '';
361
335
  }
362
336
  }
363
- case ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY: {
337
+ case 9 : {
364
338
  if (operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY) {
365
339
  return ( localize(
366
- 8821,
340
+ 8882,
367
341
  "Unable to write into tasks configuration file because the file has unsaved changes. Please save it first and then try again."
368
342
  ));
369
343
  }
370
344
  if (operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY) {
371
345
  return ( localize(
372
- 8822,
346
+ 8883,
373
347
  "Unable to write into launch configuration file because the file has unsaved changes. Please save it first and then try again."
374
348
  ));
375
349
  }
376
350
  switch (target) {
377
- case EditableConfigurationTarget.USER_LOCAL:
351
+ case 1 :
378
352
  return ( localize(
379
- 8823,
353
+ 8884,
380
354
  "Unable to write into user settings because the file has unsaved changes. Please save the user settings file first and then try again."
381
355
  ));
382
- case EditableConfigurationTarget.USER_REMOTE:
356
+ case 2 :
383
357
  return ( localize(
384
- 8824,
358
+ 8885,
385
359
  "Unable to write into remote user settings because the file has unsaved changes. Please save the remote user settings file first and then try again."
386
360
  ));
387
- case EditableConfigurationTarget.WORKSPACE:
361
+ case 3 :
388
362
  return ( localize(
389
- 8825,
363
+ 8886,
390
364
  "Unable to write into workspace settings because the file has unsaved changes. Please save the workspace settings file first and then try again."
391
365
  ));
392
- case EditableConfigurationTarget.WORKSPACE_FOLDER: {
366
+ case 4 : {
393
367
  let workspaceFolderName = '<<unknown>>';
394
368
  if (operation.resource) {
395
369
  const folder = this.contextService.getWorkspaceFolder(operation.resource);
@@ -398,7 +372,7 @@ let ConfigurationEditing = class ConfigurationEditing {
398
372
  }
399
373
  }
400
374
  return ( localize(
401
- 8826,
375
+ 8887,
402
376
  "Unable to write into folder settings because the file has unsaved changes. Please save the '{0}' folder settings file first and then try again.",
403
377
  workspaceFolderName
404
378
  ));
@@ -407,43 +381,43 @@ let ConfigurationEditing = class ConfigurationEditing {
407
381
  return '';
408
382
  }
409
383
  }
410
- case ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE:
384
+ case 10 :
411
385
  if (operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY) {
412
386
  return ( localize(
413
- 8827,
387
+ 8888,
414
388
  "Unable to write into tasks configuration file because the content of the file is newer."
415
389
  ));
416
390
  }
417
391
  if (operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY) {
418
392
  return ( localize(
419
- 8828,
393
+ 8889,
420
394
  "Unable to write into launch configuration file because the content of the file is newer."
421
395
  ));
422
396
  }
423
397
  switch (target) {
424
- case EditableConfigurationTarget.USER_LOCAL:
398
+ case 1 :
425
399
  return ( localize(
426
- 8829,
400
+ 8890,
427
401
  "Unable to write into user settings because the content of the file is newer."
428
402
  ));
429
- case EditableConfigurationTarget.USER_REMOTE:
403
+ case 2 :
430
404
  return ( localize(
431
- 8830,
405
+ 8891,
432
406
  "Unable to write into remote user settings because the content of the file is newer."
433
407
  ));
434
- case EditableConfigurationTarget.WORKSPACE:
408
+ case 3 :
435
409
  return ( localize(
436
- 8831,
410
+ 8892,
437
411
  "Unable to write into workspace settings because the content of the file is newer."
438
412
  ));
439
- case EditableConfigurationTarget.WORKSPACE_FOLDER:
413
+ case 4 :
440
414
  return ( localize(
441
- 8832,
415
+ 8893,
442
416
  "Unable to write into folder settings because the content of the file is newer."
443
417
  ));
444
418
  }
445
- case ConfigurationEditingErrorCode.ERROR_INTERNAL: return ( localize(
446
- 8833,
419
+ case 13 : return ( localize(
420
+ 8894,
447
421
  "Unable to write to {0} because of an internal error.",
448
422
  this.stringifyTarget(target)
449
423
  ));
@@ -451,14 +425,14 @@ let ConfigurationEditing = class ConfigurationEditing {
451
425
  }
452
426
  stringifyTarget(target) {
453
427
  switch (target) {
454
- case EditableConfigurationTarget.USER_LOCAL:
455
- return ( localize(8834, "User Settings"));
456
- case EditableConfigurationTarget.USER_REMOTE:
457
- return ( localize(8835, "Remote User Settings"));
458
- case EditableConfigurationTarget.WORKSPACE:
459
- return ( localize(8836, "Workspace Settings"));
460
- case EditableConfigurationTarget.WORKSPACE_FOLDER:
461
- return ( localize(8837, "Folder Settings"));
428
+ case 1 :
429
+ return ( localize(8895, "User Settings"));
430
+ case 2 :
431
+ return ( localize(8896, "Remote User Settings"));
432
+ case 3 :
433
+ return ( localize(8897, "Workspace Settings"));
434
+ case 4 :
435
+ return ( localize(8898, "Folder Settings"));
462
436
  default:
463
437
  return '';
464
438
  }
@@ -488,59 +462,59 @@ let ConfigurationEditing = class ConfigurationEditing {
488
462
  }
489
463
  async validate(target, operation, checkDirty, overrides) {
490
464
  if (this.configurationService.inspect(operation.key).policyValue !== undefined) {
491
- throw this.toConfigurationEditingError(ConfigurationEditingErrorCode.ERROR_POLICY_CONFIGURATION, target, operation);
465
+ throw this.toConfigurationEditingError(12 , target, operation);
492
466
  }
493
467
  const configurationProperties = ( (Registry.as(Extensions.Configuration))).getConfigurationProperties();
494
468
  const configurationScope = configurationProperties[operation.key]?.scope;
495
469
  if (!operation.workspaceStandAloneConfigurationKey) {
496
470
  const validKeys = ( (this.configurationService.keys())).default;
497
471
  if (validKeys.indexOf(operation.key) < 0 && !OVERRIDE_PROPERTY_REGEX.test(operation.key) && operation.value !== undefined) {
498
- throw this.toConfigurationEditingError(ConfigurationEditingErrorCode.ERROR_UNKNOWN_KEY, target, operation);
472
+ throw this.toConfigurationEditingError(0 , target, operation);
499
473
  }
500
474
  }
501
475
  if (operation.workspaceStandAloneConfigurationKey) {
502
- if ((operation.workspaceStandAloneConfigurationKey !== TASKS_CONFIGURATION_KEY) && (target === EditableConfigurationTarget.USER_LOCAL || target === EditableConfigurationTarget.USER_REMOTE)) {
503
- throw this.toConfigurationEditingError(ConfigurationEditingErrorCode.ERROR_INVALID_USER_TARGET, target, operation);
476
+ if ((operation.workspaceStandAloneConfigurationKey !== TASKS_CONFIGURATION_KEY) && ((target === 1 || target === 2) )) {
477
+ throw this.toConfigurationEditingError(4 , target, operation);
504
478
  }
505
479
  }
506
- if ((target === EditableConfigurationTarget.WORKSPACE || target === EditableConfigurationTarget.WORKSPACE_FOLDER) && this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) {
507
- throw this.toConfigurationEditingError(ConfigurationEditingErrorCode.ERROR_NO_WORKSPACE_OPENED, target, operation);
480
+ if (((target === 3 || target === 4) ) && this.contextService.getWorkbenchState() === 1 ) {
481
+ throw this.toConfigurationEditingError(8 , target, operation);
508
482
  }
509
- if (target === EditableConfigurationTarget.WORKSPACE) {
483
+ if (target === 3 ) {
510
484
  if (!operation.workspaceStandAloneConfigurationKey && !OVERRIDE_PROPERTY_REGEX.test(operation.key)) {
511
- if (configurationScope === ConfigurationScope.APPLICATION) {
512
- throw this.toConfigurationEditingError(ConfigurationEditingErrorCode.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION, target, operation);
485
+ if (configurationScope === 1 ) {
486
+ throw this.toConfigurationEditingError(1 , target, operation);
513
487
  }
514
- if (configurationScope === ConfigurationScope.MACHINE) {
515
- throw this.toConfigurationEditingError(ConfigurationEditingErrorCode.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE, target, operation);
488
+ if (configurationScope === 2 ) {
489
+ throw this.toConfigurationEditingError(2 , target, operation);
516
490
  }
517
491
  }
518
492
  }
519
- if (target === EditableConfigurationTarget.WORKSPACE_FOLDER) {
493
+ if (target === 4 ) {
520
494
  if (!operation.resource) {
521
- throw this.toConfigurationEditingError(ConfigurationEditingErrorCode.ERROR_INVALID_FOLDER_TARGET, target, operation);
495
+ throw this.toConfigurationEditingError(6 , target, operation);
522
496
  }
523
497
  if (!operation.workspaceStandAloneConfigurationKey && !OVERRIDE_PROPERTY_REGEX.test(operation.key)) {
524
498
  if (configurationScope !== undefined && !FOLDER_SCOPES.includes(configurationScope)) {
525
- throw this.toConfigurationEditingError(ConfigurationEditingErrorCode.ERROR_INVALID_FOLDER_CONFIGURATION, target, operation);
499
+ throw this.toConfigurationEditingError(3 , target, operation);
526
500
  }
527
501
  }
528
502
  }
529
503
  if (overrides.overrideIdentifiers?.length) {
530
- if (configurationScope !== ConfigurationScope.LANGUAGE_OVERRIDABLE) {
531
- throw this.toConfigurationEditingError(ConfigurationEditingErrorCode.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION, target, operation);
504
+ if (configurationScope !== 5 ) {
505
+ throw this.toConfigurationEditingError(7 , target, operation);
532
506
  }
533
507
  }
534
508
  if (!operation.resource) {
535
- throw this.toConfigurationEditingError(ConfigurationEditingErrorCode.ERROR_INVALID_FOLDER_TARGET, target, operation);
509
+ throw this.toConfigurationEditingError(6 , target, operation);
536
510
  }
537
511
  if (checkDirty && this.textFileService.isDirty(operation.resource)) {
538
- throw this.toConfigurationEditingError(ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY, target, operation);
512
+ throw this.toConfigurationEditingError(9 , target, operation);
539
513
  }
540
514
  }
541
515
  getConfigurationEditOperation(target, config, overrides) {
542
516
  if (config.key) {
543
- const standaloneConfigurationMap = target === EditableConfigurationTarget.USER_LOCAL ? USER_STANDALONE_CONFIGURATIONS : WORKSPACE_STANDALONE_CONFIGURATIONS;
517
+ const standaloneConfigurationMap = target === 1 ? USER_STANDALONE_CONFIGURATIONS : WORKSPACE_STANDALONE_CONFIGURATIONS;
544
518
  const standaloneConfigurationKeys = ( (Object.keys(standaloneConfigurationMap)));
545
519
  for (const key of standaloneConfigurationKeys) {
546
520
  const resource = this.getConfigurationFileResource(target, key, standaloneConfigurationMap[key], overrides.resource, undefined);
@@ -559,7 +533,7 @@ let ConfigurationEditing = class ConfigurationEditing {
559
533
  const configurationProperties = ( (Registry.as(Extensions.Configuration))).getConfigurationProperties();
560
534
  const configurationScope = configurationProperties[key]?.scope;
561
535
  let jsonPath = overrides.overrideIdentifiers?.length ? [keyFromOverrideIdentifiers(overrides.overrideIdentifiers), key] : [key];
562
- if (target === EditableConfigurationTarget.USER_LOCAL || target === EditableConfigurationTarget.USER_REMOTE) {
536
+ if (target === 1 || target === 2 ) {
563
537
  return { key, jsonPath, value: config.value, resource: this.getConfigurationFileResource(target, key, '', null, configurationScope) ?? undefined, target };
564
538
  }
565
539
  const resource = this.getConfigurationFileResource(target, key, FOLDER_SETTINGS_PATH, overrides.resource, configurationScope);
@@ -573,7 +547,7 @@ let ConfigurationEditing = class ConfigurationEditing {
573
547
  return !!(workspace.configuration && resource && workspace.configuration.fsPath === resource.fsPath);
574
548
  }
575
549
  getConfigurationFileResource(target, key, relativePath, resource, scope) {
576
- if (target === EditableConfigurationTarget.USER_LOCAL) {
550
+ if (target === 1 ) {
577
551
  if (key === TASKS_CONFIGURATION_KEY) {
578
552
  return this.userDataProfileService.currentProfile.tasksResource;
579
553
  }
@@ -584,21 +558,21 @@ let ConfigurationEditing = class ConfigurationEditing {
584
558
  return this.userDataProfileService.currentProfile.settingsResource;
585
559
  }
586
560
  }
587
- if (target === EditableConfigurationTarget.USER_REMOTE) {
561
+ if (target === 2 ) {
588
562
  return this.remoteSettingsResource;
589
563
  }
590
564
  const workbenchState = this.contextService.getWorkbenchState();
591
- if (workbenchState !== WorkbenchState.EMPTY) {
565
+ if (workbenchState !== 1 ) {
592
566
  const workspace = this.contextService.getWorkspace();
593
- if (target === EditableConfigurationTarget.WORKSPACE) {
594
- if (workbenchState === WorkbenchState.WORKSPACE) {
567
+ if (target === 3 ) {
568
+ if (workbenchState === 3 ) {
595
569
  return workspace.configuration ?? null;
596
570
  }
597
- if (workbenchState === WorkbenchState.FOLDER) {
571
+ if (workbenchState === 2 ) {
598
572
  return workspace.folders[0].toResource(relativePath);
599
573
  }
600
574
  }
601
- if (target === EditableConfigurationTarget.WORKSPACE_FOLDER) {
575
+ if (target === 4 ) {
602
576
  if (resource) {
603
577
  const folder = this.contextService.getWorkspaceFolder(resource);
604
578
  if (folder) {
@@ -624,4 +598,4 @@ ConfigurationEditing = ( (__decorate([
624
598
  ( (__param(11, IUriIdentityService)))
625
599
  ], ConfigurationEditing)));
626
600
 
627
- export { ConfigurationEditing, ConfigurationEditingError, ConfigurationEditingErrorCode, EditableConfigurationTarget };
601
+ export { ConfigurationEditing, ConfigurationEditingError };