@codingame/monaco-vscode-configuration-service-override 37.6.1 → 38.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.
Files changed (18) hide show
  1. package/common.js +6 -0
  2. package/package.json +3 -3
  3. package/vscode/src/vs/sessions/services/configuration/browser/configurationService.js +12 -5
  4. package/vscode/src/vs/sessions/services/workspace/browser/workspaceContextService.js +2 -2
  5. package/vscode/src/vs/workbench/api/common/configurationExtensionPoint.js +62 -62
  6. package/vscode/src/vs/workbench/contrib/workspaces/browser/workspaces.contribution.js +15 -16
  7. package/vscode/src/vs/workbench/services/configuration/browser/configurationService.d.ts +4 -1
  8. package/vscode/src/vs/workbench/services/configuration/browser/configurationService.js +52 -11
  9. package/vscode/src/vs/workbench/services/configuration/common/configurationEditing.js +43 -43
  10. package/vscode/src/vs/workbench/services/configuration/common/experimentalSettings.d.ts +12 -0
  11. package/vscode/src/vs/workbench/services/configuration/common/experimentalSettings.js +40 -0
  12. package/vscode/src/vs/workbench/services/configuration/common/managedSettingsPresentation.d.ts +15 -0
  13. package/vscode/src/vs/workbench/services/configuration/common/managedSettingsPresentation.js +55 -0
  14. package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.d.ts +1 -1
  15. package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +7 -7
  16. package/vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.d.ts +1 -1
  17. package/vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +2 -1
  18. package/vscode/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.js +4 -4
@@ -16,7 +16,7 @@ import { NullPolicyConfiguration, PolicyConfiguration } from '@codingame/monaco-
16
16
  import { Configuration } from '../common/configurationModels.js';
17
17
  import { LOCAL_MACHINE_SCOPES, LOCAL_MACHINE_PROFILE_SCOPES, PROFILE_SCOPES, APPLICATION_SCOPES, APPLY_ALL_PROFILES_SETTING, FOLDER_CONFIG_FOLDER_NAME, defaultSettingsSchemaId, userSettingsSchemaId, profileSettingsSchemaId, machineSettingsSchemaId, workspaceSettingsSchemaId, folderSettingsSchemaId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/configuration/common/configuration';
18
18
  import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
19
- import { Extensions, keyFromOverrideIdentifiers, ConfigurationScope, allSettings, applicationSettings, windowSettings, resourceSettings, machineSettings, machineOverridableSettings, applicationMachineSettings, OVERRIDE_PROPERTY_PATTERN, resourceLanguageSettingsSchemaId, configurationDefaultsSchemaId, isConfigurationDefaultSourceEquals } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configurationRegistry';
19
+ import { Extensions, keyFromOverrideIdentifiers, ConfigurationScope, allSettings, applicationSettings, windowSettings, resourceSettings, machineSettings, machineOverridableSettings, applicationMachineSettings, OVERRIDE_PROPERTY_PATTERN, resourceLanguageSettingsSchemaId, configurationDefaultsSchemaId, isConfigurationDefaultSourceEquals, getConfigurationExperimentName } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configurationRegistry';
20
20
  import { isStoredWorkspaceFolder, toWorkspaceFolders, getStoredWorkspaceFolder } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspaces/common/workspaces';
21
21
  import { EditableConfigurationTarget, ConfigurationEditing } from '../common/configurationEditing.js';
22
22
  import { DefaultConfiguration, UserConfiguration, RemoteUserConfiguration, WorkspaceConfiguration, ApplicationConfiguration, FolderConfiguration } from './configuration.js';
@@ -40,6 +40,8 @@ import { mainWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/
40
40
  import { runWhenWindowIdle } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
41
41
  import { renderAsPlaintext } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/markdownRenderer';
42
42
  import { fixSettingLinks } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/preferences/common/preferencesModels';
43
+ import { IExperimentalSettingsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/configuration/common/experimentalSettings.service';
44
+ import { isCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
43
45
 
44
46
  function getLocalUserConfigurationScopes(userDataProfile, hasRemote) {
45
47
  const isDefaultProfile = userDataProfile.isDefault || userDataProfile.useDefaultFlags?.settings;
@@ -1334,7 +1336,7 @@ let RegisterConfigurationSchemasContribution = class RegisterConfigurationSchema
1334
1336
  } : workspaceSettingsSchema;
1335
1337
  const configDefaultsSchema = {
1336
1338
  type: "object",
1337
- description: ( localize(21725, "Contribute defaults for configurations")),
1339
+ description: ( localize(24300, "Contribute defaults for configurations")),
1338
1340
  properties: Object.assign(
1339
1341
  {},
1340
1342
  this.filterDefaultOverridableProperties(machineOverridableSettings.properties),
@@ -1402,7 +1404,8 @@ let ConfigurationDefaultOverridesContribution = class ConfigurationDefaultOverri
1402
1404
  extensionService,
1403
1405
  configurationService,
1404
1406
  environmentService,
1405
- logService
1407
+ logService,
1408
+ experimentalSettingsService
1406
1409
  ) {
1407
1410
  super();
1408
1411
  this.workbenchAssignmentService = workbenchAssignmentService;
@@ -1410,10 +1413,12 @@ let ConfigurationDefaultOverridesContribution = class ConfigurationDefaultOverri
1410
1413
  this.configurationService = configurationService;
1411
1414
  this.environmentService = environmentService;
1412
1415
  this.logService = logService;
1416
+ this.experimentalSettingsService = experimentalSettingsService;
1413
1417
  this.processedExperimentalSettings = ( new Set());
1414
1418
  this.autoExperimentalSettings = ( new Set());
1415
1419
  this.pendingStartupExperimentalSettings = ( new Set());
1416
1420
  this.registeredExperimentalDefaults = ( new Map());
1421
+ this.assignmentRequests = ( new Map());
1417
1422
  this.configurationRegistry = ( Registry.as(Extensions.Configuration));
1418
1423
  this.throttler = this._register(( new Throttler()));
1419
1424
  this.throttler.queue(() => this.updateDefaults());
@@ -1432,7 +1437,7 @@ let ConfigurationDefaultOverridesContribution = class ConfigurationDefaultOverri
1432
1437
  async updateDefaults() {
1433
1438
  this.logService.trace("ConfigurationService#updateDefaults: begin");
1434
1439
  try {
1435
- await this.processExperimentalSettings(( Object.keys(this.configurationRegistry.getConfigurationProperties())), false);
1440
+ await this.processExperimentalSettings([...( Object.keys(this.configurationRegistry.getConfigurationProperties())), ...( Object.keys(this.configurationRegistry.getExcludedConfigurationProperties()))], false);
1436
1441
  } finally {
1437
1442
  await this.extensionService.whenInstalledExtensionsRegistered();
1438
1443
  this.logService.trace("ConfigurationService#updateDefaults: resetting the defaults");
@@ -1442,11 +1447,15 @@ let ConfigurationDefaultOverridesContribution = class ConfigurationDefaultOverri
1442
1447
  async processExperimentalSettings(properties, autoRefetch) {
1443
1448
  const removedDefaults = [];
1444
1449
  const addedDefaults = [];
1450
+ const assignmentUpdates = [];
1445
1451
  const allProperties = this.configurationRegistry.getConfigurationProperties();
1452
+ const excludedProperties = this.configurationRegistry.getExcludedConfigurationProperties();
1446
1453
  const defaultConfigurationsPreventingExperimentOverrides = this.configurationRegistry.getRegisteredDefaultConfigurations().filter(configuration => configuration.preventExperimentOverride);
1447
1454
  for (const property of properties) {
1448
- const schema = allProperties[property];
1455
+ const schema = allProperties[property] ?? excludedProperties[property];
1449
1456
  if (!schema?.experiment) {
1457
+ this.assignmentRequests.delete(property);
1458
+ this.experimentalSettingsService.setAssignment(property, false);
1450
1459
  const registeredDefault = this.registeredExperimentalDefaults.get(property);
1451
1460
  if (registeredDefault) {
1452
1461
  this.registeredExperimentalDefaults.delete(property);
@@ -1461,6 +1470,8 @@ let ConfigurationDefaultOverridesContribution = class ConfigurationDefaultOverri
1461
1470
  if (defaultValueSource && ( defaultConfigurationsPreventingExperimentOverrides.some(
1462
1471
  configuration => isConfigurationDefaultSourceEquals(configuration.source, defaultValueSource) && configuration.overrides?.[property] !== undefined
1463
1472
  ))) {
1473
+ this.assignmentRequests.delete(property);
1474
+ this.experimentalSettingsService.setAssignment(property, false);
1464
1475
  const registeredDefault = this.registeredExperimentalDefaults.get(property);
1465
1476
  if (registeredDefault) {
1466
1477
  this.registeredExperimentalDefaults.delete(property);
@@ -1470,16 +1481,37 @@ let ConfigurationDefaultOverridesContribution = class ConfigurationDefaultOverri
1470
1481
  this.pendingStartupExperimentalSettings.delete(property);
1471
1482
  continue;
1472
1483
  }
1473
- if (!autoRefetch && ( this.processedExperimentalSettings.has(property))) {
1484
+ const isAutoExperiment = schema.experiment.mode === "auto";
1485
+ if (( this.processedExperimentalSettings.has(property)) && (!autoRefetch || (!isAutoExperiment && !( this.pendingStartupExperimentalSettings.has(property))))) {
1474
1486
  continue;
1475
1487
  }
1476
1488
  this.processedExperimentalSettings.add(property);
1477
- const isAutoExperiment = schema.experiment.mode === "auto";
1478
1489
  if (isAutoExperiment) {
1479
1490
  this.autoExperimentalSettings.add(property);
1480
1491
  }
1492
+ const request = {};
1493
+ this.assignmentRequests.set(property, request);
1481
1494
  try {
1482
- const value = await this.workbenchAssignmentService.getTreatment(schema.experiment.name ?? `config.${property}`);
1495
+ const {
1496
+ value,
1497
+ hasAssignment
1498
+ } = await this.workbenchAssignmentService.getTreatmentWithAssignment(getConfigurationExperimentName(property, schema.experiment));
1499
+ assignmentUpdates.push(hasAssignment.then(assigned => {
1500
+ if (!this._store.isDisposed && this.assignmentRequests.get(property) === request && (allProperties[property] ?? excludedProperties[property])?.experiment === schema.experiment) {
1501
+ this.experimentalSettingsService.setAssignment(property, assigned);
1502
+ }
1503
+ }, error => {
1504
+ if (!isCancellationError(error)) {
1505
+ this.logService.error(
1506
+ "ConfigurationService#processExperimentalSettings: assignment",
1507
+ property,
1508
+ error
1509
+ );
1510
+ }
1511
+ }));
1512
+ if (this._store.isDisposed || this.assignmentRequests.get(property) !== request || (allProperties[property] ?? excludedProperties[property]) !== schema) {
1513
+ continue;
1514
+ }
1483
1515
  if (!isAutoExperiment) {
1484
1516
  if (isUndefined(value)) {
1485
1517
  this.pendingStartupExperimentalSettings.add(property);
@@ -1507,7 +1539,15 @@ let ConfigurationDefaultOverridesContribution = class ConfigurationDefaultOverri
1507
1539
  this.registeredExperimentalDefaults.delete(property);
1508
1540
  removedDefaults.push(registeredDefault);
1509
1541
  }
1510
- } catch (error) {}
1542
+ } catch (error) {
1543
+ if (isCancellationError(error)) {
1544
+ if (!isAutoExperiment && !this._store.isDisposed && this.assignmentRequests.get(property) === request) {
1545
+ this.pendingStartupExperimentalSettings.add(property);
1546
+ }
1547
+ } else {
1548
+ this.logService.error("ConfigurationService#processExperimentalSettings", property, error);
1549
+ }
1550
+ }
1511
1551
  }
1512
1552
  if (removedDefaults.length || addedDefaults.length) {
1513
1553
  this.configurationRegistry.deltaConfiguration({
@@ -1515,6 +1555,7 @@ let ConfigurationDefaultOverridesContribution = class ConfigurationDefaultOverri
1515
1555
  addedDefaults: addedDefaults.length ? addedDefaults : undefined
1516
1556
  });
1517
1557
  }
1558
+ await Promise.all(assignmentUpdates);
1518
1559
  }
1519
1560
  shouldOverride(value, schema) {
1520
1561
  if (isUndefined(value)) {
@@ -1526,7 +1567,7 @@ let ConfigurationDefaultOverridesContribution = class ConfigurationDefaultOverri
1526
1567
  return !equals(value, schema.default);
1527
1568
  }
1528
1569
  };
1529
- ConfigurationDefaultOverridesContribution = ( __decorate([( __param(0, IWorkbenchAssignmentService)), ( __param(1, IExtensionService)), ( __param(2, IConfigurationService)), ( __param(3, IWorkbenchEnvironmentService)), ( __param(4, ILogService))], ConfigurationDefaultOverridesContribution));
1570
+ ConfigurationDefaultOverridesContribution = ( __decorate([( __param(0, IWorkbenchAssignmentService)), ( __param(1, IExtensionService)), ( __param(2, IConfigurationService)), ( __param(3, IWorkbenchEnvironmentService)), ( __param(4, ILogService)), ( __param(5, IExperimentalSettingsService))], ConfigurationDefaultOverridesContribution));
1530
1571
  const workbenchContributionsRegistry = ( Registry.as(Extensions$2.Workbench));
1531
1572
  workbenchContributionsRegistry.registerWorkbenchContribution(RegisterConfigurationSchemasContribution, LifecyclePhase.Restored);
1532
1573
  registerWorkbenchContribution2(
@@ -1540,7 +1581,7 @@ configurationRegistry.registerConfiguration({
1540
1581
  properties: {
1541
1582
  [APPLY_ALL_PROFILES_SETTING]: {
1542
1583
  "type": "array",
1543
- description: ( localize(21726, "Configure settings to be applied for all profiles.")),
1584
+ description: ( localize(24301, "Configure settings to be applied for all profiles.")),
1544
1585
  "default": [],
1545
1586
  "scope": ConfigurationScope.APPLICATION,
1546
1587
  additionalProperties: true,
@@ -163,7 +163,7 @@ let ConfigurationEditing = class ConfigurationEditing {
163
163
  );
164
164
  }
165
165
  throw ( new ConfigurationEditingError(( localize(
166
- 21727,
166
+ 24302,
167
167
  "Error while writing to {0}. {1}",
168
168
  this.stringifyTarget(operation.target),
169
169
  error.message
@@ -244,7 +244,7 @@ let ConfigurationEditing = class ConfigurationEditing {
244
244
  }
245
245
  }
246
246
  onInvalidConfigurationError(error, operation) {
247
- const openStandAloneConfigurationActionLabel = operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY ? ( localize(21728, "Open Tasks Configuration")) : operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY ? ( localize(21729, "Open Launch Configuration")) : operation.workspaceStandAloneConfigurationKey === MCP_CONFIGURATION_KEY ? ( localize(21730, "Open MCP Configuration")) : null;
247
+ const openStandAloneConfigurationActionLabel = operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY ? ( localize(24303, "Open Tasks Configuration")) : operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY ? ( localize(24304, "Open Launch Configuration")) : operation.workspaceStandAloneConfigurationKey === MCP_CONFIGURATION_KEY ? ( localize(24305, "Open MCP Configuration")) : null;
248
248
  if (openStandAloneConfigurationActionLabel) {
249
249
  this.notificationService.prompt(Severity.Error, error.message, [{
250
250
  label: openStandAloneConfigurationActionLabel,
@@ -252,16 +252,16 @@ let ConfigurationEditing = class ConfigurationEditing {
252
252
  }]);
253
253
  } else {
254
254
  this.notificationService.prompt(Severity.Error, error.message, [{
255
- label: ( localize(21731, "Open Settings")),
255
+ label: ( localize(24306, "Open Settings")),
256
256
  run: () => this.openSettings(operation)
257
257
  }]);
258
258
  }
259
259
  }
260
260
  onConfigurationFileDirtyError(error, operation, scopes) {
261
- const openStandAloneConfigurationActionLabel = operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY ? ( localize(21728, "Open Tasks Configuration")) : operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY ? ( localize(21729, "Open Launch Configuration")) : null;
261
+ const openStandAloneConfigurationActionLabel = operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY ? ( localize(24303, "Open Tasks Configuration")) : operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY ? ( localize(24304, "Open Launch Configuration")) : null;
262
262
  if (openStandAloneConfigurationActionLabel) {
263
263
  this.notificationService.prompt(Severity.Error, error.message, [{
264
- label: ( localize(21732, "Save and Retry")),
264
+ label: ( localize(24307, "Save and Retry")),
265
265
  run: () => {
266
266
  const key = operation.key ? `${operation.workspaceStandAloneConfigurationKey}.${operation.key}` : operation.workspaceStandAloneConfigurationKey;
267
267
  this.writeConfiguration(operation.target, {
@@ -278,7 +278,7 @@ let ConfigurationEditing = class ConfigurationEditing {
278
278
  }]);
279
279
  } else {
280
280
  this.notificationService.prompt(Severity.Error, error.message, [{
281
- label: ( localize(21732, "Save and Retry")),
281
+ label: ( localize(24307, "Save and Retry")),
282
282
  run: () => this.writeConfiguration(operation.target, {
283
283
  key: operation.key,
284
284
  value: operation.value
@@ -287,7 +287,7 @@ let ConfigurationEditing = class ConfigurationEditing {
287
287
  scopes
288
288
  })
289
289
  }, {
290
- label: ( localize(21731, "Open Settings")),
290
+ label: ( localize(24306, "Open Settings")),
291
291
  run: () => this.openSettings(operation)
292
292
  }]);
293
293
  }
@@ -335,61 +335,61 @@ let ConfigurationEditing = class ConfigurationEditing {
335
335
  switch (error) {
336
336
  case ConfigurationEditingErrorCode.ERROR_POLICY_CONFIGURATION:
337
337
  return localize(
338
- 21733,
338
+ 24308,
339
339
  "Unable to write {0} because it is configured in system policy.",
340
340
  operation.key
341
341
  );
342
342
  case ConfigurationEditingErrorCode.ERROR_UNKNOWN_KEY:
343
343
  return localize(
344
- 21734,
344
+ 24309,
345
345
  "Unable to write to {0} because {1} is not a registered configuration.",
346
346
  this.stringifyTarget(target),
347
347
  operation.key
348
348
  );
349
349
  case ConfigurationEditingErrorCode.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION:
350
350
  return localize(
351
- 21735,
351
+ 24310,
352
352
  "Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",
353
353
  operation.key
354
354
  );
355
355
  case ConfigurationEditingErrorCode.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE:
356
356
  return localize(
357
- 21736,
357
+ 24311,
358
358
  "Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",
359
359
  operation.key
360
360
  );
361
361
  case ConfigurationEditingErrorCode.ERROR_INVALID_FOLDER_CONFIGURATION:
362
362
  return localize(
363
- 21737,
363
+ 24312,
364
364
  "Unable to write to Folder Settings because {0} does not support the folder resource scope.",
365
365
  operation.key
366
366
  );
367
367
  case ConfigurationEditingErrorCode.ERROR_INVALID_USER_TARGET:
368
368
  return localize(
369
- 21738,
369
+ 24313,
370
370
  "Unable to write to User Settings because {0} does not support for global scope.",
371
371
  operation.key
372
372
  );
373
373
  case ConfigurationEditingErrorCode.ERROR_INVALID_WORKSPACE_TARGET:
374
374
  return localize(
375
- 21739,
375
+ 24314,
376
376
  "Unable to write to Workspace Settings because {0} does not support for workspace scope in a multi folder workspace.",
377
377
  operation.key
378
378
  );
379
379
  case ConfigurationEditingErrorCode.ERROR_INVALID_FOLDER_TARGET:
380
380
  return localize(
381
- 21740,
381
+ 24315,
382
382
  "Unable to write to Folder Settings because no resource is provided."
383
383
  );
384
384
  case ConfigurationEditingErrorCode.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION:
385
385
  return localize(
386
- 21741,
386
+ 24316,
387
387
  "Unable to write to Language Settings because {0} is not a resource language setting.",
388
388
  operation.key
389
389
  );
390
390
  case ConfigurationEditingErrorCode.ERROR_NO_WORKSPACE_OPENED:
391
391
  return localize(
392
- 21742,
392
+ 24317,
393
393
  "Unable to write to {0} because no workspace is opened. Please open a workspace first and try again.",
394
394
  this.stringifyTarget(target)
395
395
  );
@@ -397,36 +397,36 @@ let ConfigurationEditing = class ConfigurationEditing {
397
397
  {
398
398
  if (operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY) {
399
399
  return localize(
400
- 21743,
400
+ 24318,
401
401
  "Unable to write into the tasks configuration file. Please open it to correct errors/warnings in it and try again."
402
402
  );
403
403
  }
404
404
  if (operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY) {
405
405
  return localize(
406
- 21744,
406
+ 24319,
407
407
  "Unable to write into the launch configuration file. Please open it to correct errors/warnings in it and try again."
408
408
  );
409
409
  }
410
410
  if (operation.workspaceStandAloneConfigurationKey === MCP_CONFIGURATION_KEY) {
411
411
  return localize(
412
- 21745,
412
+ 24320,
413
413
  "Unable to write into the MCP configuration file. Please open it to correct errors/warnings in it and try again."
414
414
  );
415
415
  }
416
416
  switch (target) {
417
417
  case EditableConfigurationTarget.USER_LOCAL:
418
418
  return localize(
419
- 21746,
419
+ 24321,
420
420
  "Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again."
421
421
  );
422
422
  case EditableConfigurationTarget.USER_REMOTE:
423
423
  return localize(
424
- 21747,
424
+ 24322,
425
425
  "Unable to write into remote user settings. Please open the remote user settings to correct errors/warnings in it and try again."
426
426
  );
427
427
  case EditableConfigurationTarget.WORKSPACE:
428
428
  return localize(
429
- 21748,
429
+ 24323,
430
430
  "Unable to write into workspace settings. Please open the workspace settings to correct errors/warnings in the file and try again."
431
431
  );
432
432
  case EditableConfigurationTarget.WORKSPACE_FOLDER:
@@ -439,7 +439,7 @@ let ConfigurationEditing = class ConfigurationEditing {
439
439
  }
440
440
  }
441
441
  return localize(
442
- 21749,
442
+ 24324,
443
443
  "Unable to write into folder settings. Please open the '{0}' folder settings to correct errors/warnings in it and try again.",
444
444
  workspaceFolderName
445
445
  );
@@ -452,36 +452,36 @@ let ConfigurationEditing = class ConfigurationEditing {
452
452
  {
453
453
  if (operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY) {
454
454
  return localize(
455
- 21750,
455
+ 24325,
456
456
  "Unable to write into tasks configuration file because the file has unsaved changes. Please save it first and then try again."
457
457
  );
458
458
  }
459
459
  if (operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY) {
460
460
  return localize(
461
- 21751,
461
+ 24326,
462
462
  "Unable to write into launch configuration file because the file has unsaved changes. Please save it first and then try again."
463
463
  );
464
464
  }
465
465
  if (operation.workspaceStandAloneConfigurationKey === MCP_CONFIGURATION_KEY) {
466
466
  return localize(
467
- 21752,
467
+ 24327,
468
468
  "Unable to write into MCP configuration file because the file has unsaved changes. Please save it first and then try again."
469
469
  );
470
470
  }
471
471
  switch (target) {
472
472
  case EditableConfigurationTarget.USER_LOCAL:
473
473
  return localize(
474
- 21753,
474
+ 24328,
475
475
  "Unable to write into user settings because the file has unsaved changes. Please save the user settings file first and then try again."
476
476
  );
477
477
  case EditableConfigurationTarget.USER_REMOTE:
478
478
  return localize(
479
- 21754,
479
+ 24329,
480
480
  "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."
481
481
  );
482
482
  case EditableConfigurationTarget.WORKSPACE:
483
483
  return localize(
484
- 21755,
484
+ 24330,
485
485
  "Unable to write into workspace settings because the file has unsaved changes. Please save the workspace settings file first and then try again."
486
486
  );
487
487
  case EditableConfigurationTarget.WORKSPACE_FOLDER:
@@ -494,7 +494,7 @@ let ConfigurationEditing = class ConfigurationEditing {
494
494
  }
495
495
  }
496
496
  return localize(
497
- 21756,
497
+ 24331,
498
498
  "Unable to write into folder settings because the file has unsaved changes. Please save the '{0}' folder settings file first and then try again.",
499
499
  workspaceFolderName
500
500
  );
@@ -506,47 +506,47 @@ let ConfigurationEditing = class ConfigurationEditing {
506
506
  case ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE:
507
507
  if (operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY) {
508
508
  return localize(
509
- 21757,
509
+ 24332,
510
510
  "Unable to write into tasks configuration file because the content of the file is newer."
511
511
  );
512
512
  }
513
513
  if (operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY) {
514
514
  return localize(
515
- 21758,
515
+ 24333,
516
516
  "Unable to write into launch configuration file because the content of the file is newer."
517
517
  );
518
518
  }
519
519
  if (operation.workspaceStandAloneConfigurationKey === MCP_CONFIGURATION_KEY) {
520
520
  return localize(
521
- 21759,
521
+ 24334,
522
522
  "Unable to write into MCP configuration file because the content of the file is newer."
523
523
  );
524
524
  }
525
525
  switch (target) {
526
526
  case EditableConfigurationTarget.USER_LOCAL:
527
527
  return localize(
528
- 21760,
528
+ 24335,
529
529
  "Unable to write into user settings because the content of the file is newer."
530
530
  );
531
531
  case EditableConfigurationTarget.USER_REMOTE:
532
532
  return localize(
533
- 21761,
533
+ 24336,
534
534
  "Unable to write into remote user settings because the content of the file is newer."
535
535
  );
536
536
  case EditableConfigurationTarget.WORKSPACE:
537
537
  return localize(
538
- 21762,
538
+ 24337,
539
539
  "Unable to write into workspace settings because the content of the file is newer."
540
540
  );
541
541
  case EditableConfigurationTarget.WORKSPACE_FOLDER:
542
542
  return localize(
543
- 21763,
543
+ 24338,
544
544
  "Unable to write into folder settings because the content of the file is newer."
545
545
  );
546
546
  }
547
547
  case ConfigurationEditingErrorCode.ERROR_INTERNAL:
548
548
  return localize(
549
- 21764,
549
+ 24339,
550
550
  "Unable to write to {0} because of an internal error.",
551
551
  this.stringifyTarget(target)
552
552
  );
@@ -555,13 +555,13 @@ let ConfigurationEditing = class ConfigurationEditing {
555
555
  stringifyTarget(target) {
556
556
  switch (target) {
557
557
  case EditableConfigurationTarget.USER_LOCAL:
558
- return localize(21765, "User Settings");
558
+ return localize(24340, "User Settings");
559
559
  case EditableConfigurationTarget.USER_REMOTE:
560
- return localize(21766, "Remote User Settings");
560
+ return localize(24341, "Remote User Settings");
561
561
  case EditableConfigurationTarget.WORKSPACE:
562
- return localize(21767, "Workspace Settings");
562
+ return localize(24342, "Workspace Settings");
563
563
  case EditableConfigurationTarget.WORKSPACE_FOLDER:
564
- return localize(21768, "Folder Settings");
564
+ return localize(24343, "Folder Settings");
565
565
  default:
566
566
  return "";
567
567
  }
@@ -0,0 +1,12 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { IExperimentalSettingsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/configuration/common/experimentalSettings.service";
3
+ export declare class ExperimentalSettingsService extends Disposable implements IExperimentalSettingsService {
4
+ readonly _serviceBrand: undefined;
5
+ private readonly assignments;
6
+ private pendingChanges;
7
+ private readonly _onDidChangeAssignments;
8
+ readonly onDidChangeAssignments: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<ReadonlySet<string>>;
9
+ private readonly changeScheduler;
10
+ hasAssignment(setting: string): boolean;
11
+ setAssignment(setting: string, assigned: boolean): void;
12
+ }
@@ -0,0 +1,40 @@
1
+
2
+ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
3
+ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
+ import { RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
5
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
6
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
7
+
8
+ class ExperimentalSettingsService extends Disposable {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.assignments = ( new Set());
12
+ this.pendingChanges = ( new Set());
13
+ this._onDidChangeAssignments = this._register(( new Emitter()));
14
+ this.onDidChangeAssignments = this._onDidChangeAssignments.event;
15
+ this.changeScheduler = this._register(( new RunOnceScheduler(() => {
16
+ const changes = this.pendingChanges;
17
+ this.pendingChanges = ( new Set());
18
+ this._onDidChangeAssignments.fire(changes);
19
+ }, 0)));
20
+ }
21
+ hasAssignment(setting) {
22
+ return ( this.assignments.has(setting));
23
+ }
24
+ setAssignment(setting, assigned) {
25
+ if (( this.assignments.has(setting)) === assigned) {
26
+ return;
27
+ }
28
+ if (assigned) {
29
+ this.assignments.add(setting);
30
+ } else {
31
+ this.assignments.delete(setting);
32
+ }
33
+ this.pendingChanges.add(setting);
34
+ if (!this.changeScheduler.isScheduled()) {
35
+ this.changeScheduler.schedule();
36
+ }
37
+ }
38
+ }
39
+
40
+ export { ExperimentalSettingsService };
@@ -0,0 +1,15 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { ManagedSettingsPresentationValue } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configurationRegistry";
3
+ import { IManagedSettingsService } from "@codingame/monaco-vscode-api/vscode/vs/platform/policy/common/copilotManagedSettings.service";
4
+ import { IManagedSettingsPresentationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/configuration/common/managedSettingsPresentation.service";
5
+ export declare class ManagedSettingsPresentationService extends Disposable implements IManagedSettingsPresentationService {
6
+ private readonly managedSettingsService;
7
+ readonly _serviceBrand: undefined;
8
+ private readonly registry;
9
+ private values;
10
+ private readonly _onDidChange;
11
+ readonly onDidChange: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<ReadonlySet<string>>;
12
+ constructor(managedSettingsService: IManagedSettingsService);
13
+ getValue(setting: string, localValue?: unknown): ManagedSettingsPresentationValue | undefined;
14
+ private update;
15
+ }
@@ -0,0 +1,55 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
4
+ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
+ import { equals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
6
+ import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configurationRegistry';
7
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
8
+ import { IManagedSettingsService } from '@codingame/monaco-vscode-api/vscode/vs/platform/policy/common/copilotManagedSettings.service';
9
+ import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
10
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
11
+
12
+ let ManagedSettingsPresentationService = class ManagedSettingsPresentationService extends Disposable {
13
+ constructor(managedSettingsService) {
14
+ super();
15
+ this.managedSettingsService = managedSettingsService;
16
+ this.registry = ( Registry.as(Extensions.Configuration));
17
+ this.values = ( new Map());
18
+ this._onDidChange = this._register(( new Emitter()));
19
+ this.onDidChange = this._onDidChange.event;
20
+ this.update();
21
+ this._register(managedSettingsService.onDidChangeManagedSettings(() => this.update()));
22
+ this._register(this.registry.onDidUpdateConfiguration(() => this.update()));
23
+ }
24
+ getValue(setting, localValue) {
25
+ return this.registry.getConfigurationProperties()[setting]?.managedSettingsPresentation?.(key => this.managedSettingsService.getManagedSettingValue(key), localValue);
26
+ }
27
+ update() {
28
+ const values = ( new Map());
29
+ const changed = ( new Set());
30
+ for (const [key, property] of Object.entries(this.registry.getConfigurationProperties())) {
31
+ if (!property.managedSettingsPresentation) {
32
+ continue;
33
+ }
34
+ const value = this.getValue(key);
35
+ if (value !== undefined) {
36
+ values.set(key, value);
37
+ }
38
+ if (!equals(value, this.values.get(key))) {
39
+ changed.add(key);
40
+ }
41
+ }
42
+ for (const key of ( this.values.keys())) {
43
+ if (!( values.has(key))) {
44
+ changed.add(key);
45
+ }
46
+ }
47
+ this.values = values;
48
+ if (changed.size) {
49
+ this._onDidChange.fire(changed);
50
+ }
51
+ }
52
+ };
53
+ ManagedSettingsPresentationService = ( __decorate([( __param(0, IManagedSettingsService))], ManagedSettingsPresentationService));
54
+
55
+ export { ManagedSettingsPresentationService };
@@ -10,7 +10,7 @@ import { IWorkspaceFolderData } from "@codingame/monaco-vscode-api/vscode/vs/pla
10
10
  import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service";
11
11
  import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
12
12
  import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
13
- import { IPathService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service";
13
+ import { IPathService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService";
14
14
  import { AbstractVariableResolverService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/configurationResolver/common/variableResolver";
15
15
  export declare abstract class BaseConfigurationResolverService extends AbstractVariableResolverService {
16
16
  private readonly configurationService;