@codingame/monaco-vscode-configuration-service-override 9.0.3 → 10.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configuration.js +7 -4
- package/package.json +3 -3
- package/tools.js +4 -2
- package/vscode/src/vs/editor/common/services/textResourceConfigurationService.js +10 -11
- package/vscode/src/vs/workbench/api/common/configurationExtensionPoint.js +48 -48
- package/vscode/src/vs/workbench/contrib/workspaces/browser/workspaces.contribution.js +13 -15
- package/vscode/src/vs/workbench/services/configuration/browser/configuration.js +18 -16
- package/vscode/src/vs/workbench/services/configuration/browser/configurationService.js +85 -86
- package/vscode/src/vs/workbench/services/configuration/common/configurationCache.js +1 -2
- package/vscode/src/vs/workbench/services/configuration/common/configurationEditing.js +112 -138
- package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +12 -15
- package/vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +0 -1
- package/vscode/src/vs/workbench/services/textresourceProperties/common/textResourcePropertiesService.js +4 -6
- package/vscode/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.js +17 -19
- package/vscode/src/vs/workbench/services/workspaces/browser/workspacesService.js +8 -11
|
@@ -2,12 +2,11 @@ import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
|
|
|
2
2
|
import { getErrorMessage } from 'vscode/vscode/vs/base/common/errors';
|
|
3
3
|
import { Disposable, MutableDisposable, combinedDisposable, toDisposable, DisposableStore, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
4
|
import { RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
|
|
5
|
-
import {
|
|
5
|
+
import { whenProviderRegistered } from 'vscode/vscode/vs/platform/files/common/files';
|
|
6
6
|
import { UserSettings, ConfigurationModelParser, ConfigurationModel } from 'vscode/vscode/vs/platform/configuration/common/configurationModels';
|
|
7
7
|
import { StandaloneConfigurationModelParser, WorkspaceConfigurationModelParser } from '../common/configurationModels.js';
|
|
8
8
|
import { APPLY_ALL_PROFILES_SETTING, TASKS_CONFIGURATION_KEY, REMOTE_MACHINE_SCOPES, WORKSPACE_SCOPES, FOLDER_SETTINGS_NAME, FOLDER_SCOPES, LAUNCH_CONFIGURATION_KEY } from 'vscode/vscode/vs/workbench/services/configuration/common/configuration';
|
|
9
|
-
import {
|
|
10
|
-
import { Extensions, OVERRIDE_PROPERTY_REGEX, ConfigurationScope } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
9
|
+
import { Extensions, OVERRIDE_PROPERTY_REGEX } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
11
10
|
import { equals } from 'vscode/vscode/vs/base/common/objects';
|
|
12
11
|
import { hash } from 'vscode/vscode/vs/base/common/hash';
|
|
13
12
|
import { joinPath } from 'vscode/vscode/vs/base/common/resources';
|
|
@@ -93,7 +92,7 @@ class DefaultConfiguration extends DefaultConfiguration$1 {
|
|
|
93
92
|
}
|
|
94
93
|
class ApplicationConfiguration extends UserSettings {
|
|
95
94
|
constructor(userDataProfilesService, fileService, uriIdentityService, logService) {
|
|
96
|
-
super(userDataProfilesService.defaultProfile.settingsResource, { scopes: [
|
|
95
|
+
super(userDataProfilesService.defaultProfile.settingsResource, { scopes: [1 ] }, uriIdentityService.extUri, fileService, logService);
|
|
97
96
|
this._onDidChangeConfiguration = this._register(( new Emitter()));
|
|
98
97
|
this.onDidChangeConfiguration = this._onDidChangeConfiguration.event;
|
|
99
98
|
this._register(this.onDidChange(() => this.reloadConfigurationScheduler.schedule()));
|
|
@@ -205,8 +204,8 @@ class FileServiceBasedConfiguration extends Disposable {
|
|
|
205
204
|
}
|
|
206
205
|
catch (error) {
|
|
207
206
|
this.logService.trace(`Error while resolving configuration file '${( resource.toString())}': ${getErrorMessage(error)}`);
|
|
208
|
-
if (error.fileOperationResult !==
|
|
209
|
-
&& error.fileOperationResult !==
|
|
207
|
+
if (error.fileOperationResult !== 1
|
|
208
|
+
&& error.fileOperationResult !== 9 ) {
|
|
210
209
|
this.logService.error(error);
|
|
211
210
|
}
|
|
212
211
|
}
|
|
@@ -259,20 +258,20 @@ class FileServiceBasedConfiguration extends Disposable {
|
|
|
259
258
|
return true;
|
|
260
259
|
}
|
|
261
260
|
if (( this.allResources.some(
|
|
262
|
-
resource => event.contains(this.uriIdentityService.extUri.dirname(resource),
|
|
261
|
+
resource => event.contains(this.uriIdentityService.extUri.dirname(resource), 2 )
|
|
263
262
|
))) {
|
|
264
263
|
return true;
|
|
265
264
|
}
|
|
266
265
|
return false;
|
|
267
266
|
}
|
|
268
267
|
handleFileOperationEvent(event) {
|
|
269
|
-
if ((event.isOperation(
|
|
268
|
+
if ((event.isOperation(0 ) || event.isOperation(3 ) || event.isOperation(1 ) || event.isOperation(4 ))
|
|
270
269
|
&& ( this.allResources.some(
|
|
271
270
|
resource => this.uriIdentityService.extUri.isEqual(event.resource, resource)
|
|
272
271
|
))) {
|
|
273
272
|
return true;
|
|
274
273
|
}
|
|
275
|
-
if (event.isOperation(
|
|
274
|
+
if (event.isOperation(1 ) && ( this.allResources.some(
|
|
276
275
|
resource => this.uriIdentityService.extUri.isEqual(event.resource, this.uriIdentityService.extUri.dirname(resource))
|
|
277
276
|
))) {
|
|
278
277
|
return true;
|
|
@@ -345,7 +344,7 @@ class RemoteUserConfiguration extends Disposable {
|
|
|
345
344
|
content = await this._userConfiguration.resolveContent();
|
|
346
345
|
}
|
|
347
346
|
catch (error) {
|
|
348
|
-
if (error.fileOperationResult !==
|
|
347
|
+
if (error.fileOperationResult !== 1 ) {
|
|
349
348
|
return;
|
|
350
349
|
}
|
|
351
350
|
}
|
|
@@ -418,21 +417,24 @@ class FileServiceBasedRemoteUserConfiguration extends Disposable {
|
|
|
418
417
|
return this.parser.restrictedConfigurations;
|
|
419
418
|
}
|
|
420
419
|
handleFileChangesEvent(event) {
|
|
421
|
-
let affectedByChanges =
|
|
422
|
-
if (event.contains(this.configurationResource,
|
|
420
|
+
let affectedByChanges = false;
|
|
421
|
+
if (event.contains(this.configurationResource, 1 )) {
|
|
423
422
|
affectedByChanges = true;
|
|
424
423
|
this.onResourceExists(true);
|
|
425
424
|
}
|
|
426
|
-
else if (event.contains(this.configurationResource,
|
|
425
|
+
else if (event.contains(this.configurationResource, 2 )) {
|
|
427
426
|
affectedByChanges = true;
|
|
428
427
|
this.onResourceExists(false);
|
|
429
428
|
}
|
|
429
|
+
else if (event.contains(this.configurationResource, 0 )) {
|
|
430
|
+
affectedByChanges = true;
|
|
431
|
+
}
|
|
430
432
|
if (affectedByChanges) {
|
|
431
433
|
this.reloadConfigurationScheduler.schedule();
|
|
432
434
|
}
|
|
433
435
|
}
|
|
434
436
|
handleFileOperationEvent(event) {
|
|
435
|
-
if ((event.isOperation(
|
|
437
|
+
if ((event.isOperation(0 ) || event.isOperation(3 ) || event.isOperation(1 ) || event.isOperation(4 ))
|
|
436
438
|
&& this.uriIdentityService.extUri.isEqual(event.resource, this.configurationResource)) {
|
|
437
439
|
this.reloadConfigurationScheduler.schedule();
|
|
438
440
|
}
|
|
@@ -600,7 +602,7 @@ class FileServiceBasedWorkspaceConfiguration extends Disposable {
|
|
|
600
602
|
this.onDidChange = this._onDidChange.event;
|
|
601
603
|
this.workspaceConfigurationModelParser = ( new WorkspaceConfigurationModelParser('', logService));
|
|
602
604
|
this.workspaceSettings = ConfigurationModel.createEmptyModel(logService);
|
|
603
|
-
this._register(Event.any(Event.filter(this.fileService.onDidFilesChange, e => !!this._workspaceIdentifier && e.contains(this._workspaceIdentifier.configPath)), Event.filter(this.fileService.onDidRunOperation, e => !!this._workspaceIdentifier && (e.isOperation(
|
|
605
|
+
this._register(Event.any(Event.filter(this.fileService.onDidFilesChange, e => !!this._workspaceIdentifier && e.contains(this._workspaceIdentifier.configPath)), Event.filter(this.fileService.onDidRunOperation, e => !!this._workspaceIdentifier && (e.isOperation(0 ) || e.isOperation(3 ) || e.isOperation(1 ) || e.isOperation(4 )) && uriIdentityService.extUri.isEqual(e.resource, this._workspaceIdentifier.configPath)))(() => this.reloadConfigurationScheduler.schedule()));
|
|
604
606
|
this.reloadConfigurationScheduler = this._register(( new RunOnceScheduler(() => this._onDidChange.fire(), 50)));
|
|
605
607
|
this.workspaceConfigWatcher = this._register(this.watchWorkspaceConfigurationFile());
|
|
606
608
|
}
|
|
@@ -801,7 +803,7 @@ class FolderConfiguration extends Disposable {
|
|
|
801
803
|
this.configurationCache = configurationCache;
|
|
802
804
|
this._onDidChange = this._register(( new Emitter()));
|
|
803
805
|
this.onDidChange = this._onDidChange.event;
|
|
804
|
-
this.scopes =
|
|
806
|
+
this.scopes = 3 === this.workbenchState ? FOLDER_SCOPES : WORKSPACE_SCOPES;
|
|
805
807
|
this.configurationFolder = uriIdentityService.extUri.joinPath(workspaceFolder.uri, configFolderRelativePath);
|
|
806
808
|
this.cachedFolderConfiguration = ( new CachedFolderConfiguration(
|
|
807
809
|
workspaceFolder.uri,
|
|
@@ -6,23 +6,22 @@ import { equals } from 'vscode/vscode/vs/base/common/objects';
|
|
|
6
6
|
import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
7
7
|
import { Barrier, Queue, Promises, Delayer } from 'vscode/vscode/vs/base/common/async';
|
|
8
8
|
import { Extensions as Extensions$1 } from 'vscode/vscode/vs/platform/jsonschemas/common/jsonContributionRegistry';
|
|
9
|
-
import { Workspace as Workspace$1,
|
|
9
|
+
import { Workspace as Workspace$1, isWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceFolder, toWorkspaceFolder } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
10
10
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
11
11
|
import { ConfigurationModel, mergeChanges, ConfigurationChangeEvent } from 'vscode/vscode/vs/platform/configuration/common/configurationModels';
|
|
12
|
-
import { isConfigurationOverrides, isConfigurationUpdateOverrides,
|
|
12
|
+
import { isConfigurationOverrides, isConfigurationUpdateOverrides, ConfigurationTargetToString } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
13
13
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
14
14
|
import { NullPolicyConfiguration, PolicyConfiguration } from 'vscode/vscode/vs/platform/configuration/common/configurations';
|
|
15
15
|
import { Configuration } from '../common/configurationModels.js';
|
|
16
16
|
import { LOCAL_MACHINE_SCOPES, LOCAL_MACHINE_PROFILE_SCOPES, PROFILE_SCOPES, APPLY_ALL_PROFILES_SETTING, FOLDER_CONFIG_FOLDER_NAME, defaultSettingsSchemaId, userSettingsSchemaId, profileSettingsSchemaId, machineSettingsSchemaId, workspaceSettingsSchemaId, folderSettingsSchemaId } from 'vscode/vscode/vs/workbench/services/configuration/common/configuration';
|
|
17
17
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
18
|
-
import { Extensions,
|
|
18
|
+
import { Extensions, keyFromOverrideIdentifiers, allSettings, applicationSettings, windowSettings, resourceSettings, machineSettings, machineOverridableSettings, OVERRIDE_PROPERTY_PATTERN, resourceLanguageSettingsSchemaId, configurationDefaultsSchemaId } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
19
19
|
import { isStoredWorkspaceFolder, toWorkspaceFolders, getStoredWorkspaceFolder } from 'vscode/vscode/vs/platform/workspaces/common/workspaces';
|
|
20
|
-
import {
|
|
20
|
+
import { ConfigurationEditing } from '../common/configurationEditing.js';
|
|
21
21
|
import { DefaultConfiguration, UserConfiguration, RemoteUserConfiguration, WorkspaceConfiguration, ApplicationConfiguration, FolderConfiguration } from './configuration.js';
|
|
22
22
|
import { mark } from 'vscode/vscode/vs/base/common/performance';
|
|
23
23
|
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
24
|
-
import { Extensions as Extensions$2, registerWorkbenchContribution2
|
|
25
|
-
import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
24
|
+
import { Extensions as Extensions$2, registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
26
25
|
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
27
26
|
import { toErrorMessage } from 'vscode/vscode/vs/base/common/errorMessage';
|
|
28
27
|
import { IWorkspaceTrustManagementService } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust.service';
|
|
@@ -160,12 +159,12 @@ class WorkspaceService extends Disposable {
|
|
|
160
159
|
}
|
|
161
160
|
getWorkbenchState() {
|
|
162
161
|
if (this.workspace.configuration) {
|
|
163
|
-
return
|
|
162
|
+
return 3 ;
|
|
164
163
|
}
|
|
165
164
|
if (this.workspace.folders.length === 1) {
|
|
166
|
-
return
|
|
165
|
+
return 2 ;
|
|
167
166
|
}
|
|
168
|
-
return
|
|
167
|
+
return 1 ;
|
|
169
168
|
}
|
|
170
169
|
getWorkspaceFolder(resource) {
|
|
171
170
|
return this.workspace.getFolder(resource);
|
|
@@ -184,7 +183,7 @@ class WorkspaceService extends Disposable {
|
|
|
184
183
|
}
|
|
185
184
|
isCurrentWorkspace(workspaceIdOrFolder) {
|
|
186
185
|
switch (this.getWorkbenchState()) {
|
|
187
|
-
case
|
|
186
|
+
case 2 : {
|
|
188
187
|
let folderUri = undefined;
|
|
189
188
|
if (URI.isUri(workspaceIdOrFolder)) {
|
|
190
189
|
folderUri = workspaceIdOrFolder;
|
|
@@ -194,13 +193,13 @@ class WorkspaceService extends Disposable {
|
|
|
194
193
|
}
|
|
195
194
|
return URI.isUri(folderUri) && this.uriIdentityService.extUri.isEqual(folderUri, this.workspace.folders[0].uri);
|
|
196
195
|
}
|
|
197
|
-
case
|
|
196
|
+
case 3 :
|
|
198
197
|
return isWorkspaceIdentifier(workspaceIdOrFolder) && this.workspace.id === workspaceIdOrFolder.id;
|
|
199
198
|
}
|
|
200
199
|
return false;
|
|
201
200
|
}
|
|
202
201
|
async doUpdateFolders(foldersToAdd, foldersToRemove, index) {
|
|
203
|
-
if (this.getWorkbenchState() !==
|
|
202
|
+
if (this.getWorkbenchState() !== 3 ) {
|
|
204
203
|
return Promise.resolve(undefined);
|
|
205
204
|
}
|
|
206
205
|
if (foldersToAdd.length + foldersToRemove.length === 0) {
|
|
@@ -290,7 +289,7 @@ class WorkspaceService extends Disposable {
|
|
|
290
289
|
}
|
|
291
290
|
const inspect = this.inspect(key, { resource: overrides?.resource, overrideIdentifier: overrides?.overrideIdentifiers ? overrides.overrideIdentifiers[0] : undefined });
|
|
292
291
|
targets.push(...this.deriveConfigurationTargets(key, value, inspect));
|
|
293
|
-
if (equals(value, inspect.defaultValue) && targets.length === 1 && (targets[0] ===
|
|
292
|
+
if (equals(value, inspect.defaultValue) && targets.length === 1 && ((targets[0] === 2 || targets[0] === 3) )) {
|
|
294
293
|
value = undefined;
|
|
295
294
|
}
|
|
296
295
|
}
|
|
@@ -312,22 +311,22 @@ class WorkspaceService extends Disposable {
|
|
|
312
311
|
return;
|
|
313
312
|
}
|
|
314
313
|
switch (target) {
|
|
315
|
-
case
|
|
314
|
+
case 7 :
|
|
316
315
|
this.reloadDefaultConfiguration();
|
|
317
316
|
return;
|
|
318
|
-
case
|
|
317
|
+
case 2 : {
|
|
319
318
|
const { local, remote } = await this.reloadUserConfiguration();
|
|
320
319
|
await this.loadConfiguration(this._configuration.applicationConfiguration, local, remote, true);
|
|
321
320
|
return;
|
|
322
321
|
}
|
|
323
|
-
case
|
|
322
|
+
case 3 :
|
|
324
323
|
await this.reloadLocalUserConfiguration();
|
|
325
324
|
return;
|
|
326
|
-
case
|
|
325
|
+
case 4 :
|
|
327
326
|
await this.reloadRemoteUserConfiguration();
|
|
328
327
|
return;
|
|
329
|
-
case
|
|
330
|
-
case
|
|
328
|
+
case 5 :
|
|
329
|
+
case 6 :
|
|
331
330
|
await this.reloadWorkspaceConfiguration();
|
|
332
331
|
return;
|
|
333
332
|
}
|
|
@@ -369,7 +368,7 @@ class WorkspaceService extends Disposable {
|
|
|
369
368
|
}
|
|
370
369
|
folderConfigurationModels.push(configurationModel);
|
|
371
370
|
}
|
|
372
|
-
if (this.getWorkbenchState() ===
|
|
371
|
+
if (this.getWorkbenchState() === 2 ) {
|
|
373
372
|
if (folderConfigurationModels[0]) {
|
|
374
373
|
this._configuration.updateWorkspaceConfiguration(folderConfigurationModels[0]);
|
|
375
374
|
}
|
|
@@ -391,7 +390,7 @@ class WorkspaceService extends Disposable {
|
|
|
391
390
|
this.restrictedSettings.workspaceFolder?.forEach((value) => keys.push(...value));
|
|
392
391
|
keys = distinct(keys);
|
|
393
392
|
if (keys.length) {
|
|
394
|
-
this.triggerConfigurationChange({ keys, overrides: [] }, { data, workspace: this.workspace },
|
|
393
|
+
this.triggerConfigurationChange({ keys, overrides: [] }, { data, workspace: this.workspace }, 5 );
|
|
395
394
|
}
|
|
396
395
|
}
|
|
397
396
|
}
|
|
@@ -399,7 +398,7 @@ class WorkspaceService extends Disposable {
|
|
|
399
398
|
this.instantiationService = instantiationService;
|
|
400
399
|
}
|
|
401
400
|
isSettingAppliedForAllProfiles(key) {
|
|
402
|
-
if (this.configurationRegistry.getConfigurationProperties()[key]?.scope ===
|
|
401
|
+
if (this.configurationRegistry.getConfigurationProperties()[key]?.scope === 1 ) {
|
|
403
402
|
return true;
|
|
404
403
|
}
|
|
405
404
|
const allProfilesSettings = this.getValue(APPLY_ALL_PROFILES_SETTING) ?? [];
|
|
@@ -570,10 +569,10 @@ class WorkspaceService extends Disposable {
|
|
|
570
569
|
}
|
|
571
570
|
async reloadWorkspaceConfiguration() {
|
|
572
571
|
const workbenchState = this.getWorkbenchState();
|
|
573
|
-
if (workbenchState ===
|
|
572
|
+
if (workbenchState === 2 ) {
|
|
574
573
|
return this.onWorkspaceFolderConfigurationChanged(this.workspace.folders[0]);
|
|
575
574
|
}
|
|
576
|
-
if (workbenchState ===
|
|
575
|
+
if (workbenchState === 3 ) {
|
|
577
576
|
return this.workspaceConfiguration.reload().then(() => this.onWorkspaceConfigurationChanged(false));
|
|
578
577
|
}
|
|
579
578
|
}
|
|
@@ -604,15 +603,15 @@ class WorkspaceService extends Disposable {
|
|
|
604
603
|
this.initialized = true;
|
|
605
604
|
if (trigger) {
|
|
606
605
|
const change = this._configuration.compare(currentConfiguration);
|
|
607
|
-
this.triggerConfigurationChange(change, { data: currentConfiguration.toData(), workspace: this.workspace },
|
|
606
|
+
this.triggerConfigurationChange(change, { data: currentConfiguration.toData(), workspace: this.workspace }, 5 );
|
|
608
607
|
}
|
|
609
608
|
this.updateRestrictedSettings();
|
|
610
609
|
}
|
|
611
610
|
getWorkspaceConfigurationModel(folderConfigurations) {
|
|
612
611
|
switch (this.getWorkbenchState()) {
|
|
613
|
-
case
|
|
612
|
+
case 2 :
|
|
614
613
|
return folderConfigurations[0];
|
|
615
|
-
case
|
|
614
|
+
case 3 :
|
|
616
615
|
return this.workspaceConfiguration.getConfiguration();
|
|
617
616
|
default:
|
|
618
617
|
return ConfigurationModel.createEmptyModel(this.logService);
|
|
@@ -648,7 +647,7 @@ class WorkspaceService extends Disposable {
|
|
|
648
647
|
this._configuration.updateLocalUserConfiguration(this.localUserConfiguration.reparse());
|
|
649
648
|
this._configuration.updateRemoteUserConfiguration(this.remoteUserConfiguration.reparse());
|
|
650
649
|
}
|
|
651
|
-
if (this.getWorkbenchState() ===
|
|
650
|
+
if (this.getWorkbenchState() === 2 ) {
|
|
652
651
|
const folderConfiguration = this.cachedFolderConfigs.get(this.workspace.folders[0].uri);
|
|
653
652
|
if (folderConfiguration) {
|
|
654
653
|
this._configuration.updateWorkspaceConfiguration(folderConfiguration.reparse());
|
|
@@ -664,14 +663,14 @@ class WorkspaceService extends Disposable {
|
|
|
664
663
|
}
|
|
665
664
|
}
|
|
666
665
|
}
|
|
667
|
-
this.triggerConfigurationChange(change, { data: previousData, workspace: this.workspace },
|
|
666
|
+
this.triggerConfigurationChange(change, { data: previousData, workspace: this.workspace }, 7 );
|
|
668
667
|
this.updateRestrictedSettings();
|
|
669
668
|
}
|
|
670
669
|
}
|
|
671
670
|
onPolicyConfigurationChanged(policyConfiguration) {
|
|
672
671
|
const previous = { data: this._configuration.toData(), workspace: this.workspace };
|
|
673
672
|
const change = this._configuration.compareAndUpdatePolicyConfiguration(policyConfiguration);
|
|
674
|
-
this.triggerConfigurationChange(change, previous,
|
|
673
|
+
this.triggerConfigurationChange(change, previous, 7 );
|
|
675
674
|
}
|
|
676
675
|
onApplicationConfigurationChanged(applicationConfiguration) {
|
|
677
676
|
const previous = { data: this._configuration.toData(), workspace: this.workspace };
|
|
@@ -681,7 +680,7 @@ class WorkspaceService extends Disposable {
|
|
|
681
680
|
const configurationProperties = this.configurationRegistry.getConfigurationProperties();
|
|
682
681
|
const changedKeys = [];
|
|
683
682
|
for (const changedKey of change.keys) {
|
|
684
|
-
if (configurationProperties[changedKey]?.scope ===
|
|
683
|
+
if (configurationProperties[changedKey]?.scope === 1 ) {
|
|
685
684
|
changedKeys.push(changedKey);
|
|
686
685
|
if (changedKey === APPLY_ALL_PROFILES_SETTING) {
|
|
687
686
|
for (const previousAllProfileSetting of previousAllProfilesSettings) {
|
|
@@ -704,17 +703,17 @@ class WorkspaceService extends Disposable {
|
|
|
704
703
|
if (change.keys.includes(APPLY_ALL_PROFILES_SETTING)) {
|
|
705
704
|
this._configuration.updateLocalUserConfiguration(this.localUserConfiguration.reparse({ exclude: currentAllProfilesSettings }));
|
|
706
705
|
}
|
|
707
|
-
this.triggerConfigurationChange(change, previous,
|
|
706
|
+
this.triggerConfigurationChange(change, previous, 2 );
|
|
708
707
|
}
|
|
709
708
|
onLocalUserConfigurationChanged(userConfiguration) {
|
|
710
709
|
const previous = { data: this._configuration.toData(), workspace: this.workspace };
|
|
711
710
|
const change = this._configuration.compareAndUpdateLocalUserConfiguration(userConfiguration);
|
|
712
|
-
this.triggerConfigurationChange(change, previous,
|
|
711
|
+
this.triggerConfigurationChange(change, previous, 2 );
|
|
713
712
|
}
|
|
714
713
|
onRemoteUserConfigurationChanged(userConfiguration) {
|
|
715
714
|
const previous = { data: this._configuration.toData(), workspace: this.workspace };
|
|
716
715
|
const change = this._configuration.compareAndUpdateRemoteUserConfiguration(userConfiguration);
|
|
717
|
-
this.triggerConfigurationChange(change, previous,
|
|
716
|
+
this.triggerConfigurationChange(change, previous, 2 );
|
|
718
717
|
}
|
|
719
718
|
async onWorkspaceConfigurationChanged(fromCache) {
|
|
720
719
|
if (this.workspace && this.workspace.configuration) {
|
|
@@ -757,7 +756,7 @@ class WorkspaceService extends Disposable {
|
|
|
757
756
|
const workspaceFolderDelta = delta(folderRestrictedSettings, previous, (a, b) => a.localeCompare(b));
|
|
758
757
|
changed.push(...workspaceFolderDelta.added, ...workspaceFolderDelta.removed);
|
|
759
758
|
}
|
|
760
|
-
const workspace = this.getWorkbenchState() ===
|
|
759
|
+
const workspace = this.getWorkbenchState() === 3 ? this.workspaceConfiguration.getRestrictedSettings().sort((a, b) => a.localeCompare(b))
|
|
761
760
|
: this.workspace.folders[0] ? (workspaceFolderMap.get(this.workspace.folders[0].uri) || []) : [];
|
|
762
761
|
const workspaceDelta = delta(workspace, this._restrictedSettings.workspace || [], (a, b) => a.localeCompare(b));
|
|
763
762
|
changed.push(...workspaceDelta.added, ...workspaceDelta.removed);
|
|
@@ -781,11 +780,11 @@ class WorkspaceService extends Disposable {
|
|
|
781
780
|
this.workspace.folders = workspaceFolders;
|
|
782
781
|
const change = await this.onFoldersChanged();
|
|
783
782
|
await this.handleWillChangeWorkspaceFolders(changes, fromCache);
|
|
784
|
-
this.triggerConfigurationChange(change, previous,
|
|
783
|
+
this.triggerConfigurationChange(change, previous, 6 );
|
|
785
784
|
this._onDidChangeWorkspaceFolders.fire(changes);
|
|
786
785
|
}
|
|
787
786
|
else {
|
|
788
|
-
this.triggerConfigurationChange(change, previous,
|
|
787
|
+
this.triggerConfigurationChange(change, previous, 5 );
|
|
789
788
|
}
|
|
790
789
|
this.updateRestrictedSettings();
|
|
791
790
|
}
|
|
@@ -807,12 +806,12 @@ class WorkspaceService extends Disposable {
|
|
|
807
806
|
const [folderConfiguration] = await this.loadFolderConfigurations([folder]);
|
|
808
807
|
const previous = { data: this._configuration.toData(), workspace: this.workspace };
|
|
809
808
|
const folderConfigurationChange = this._configuration.compareAndUpdateFolderConfiguration(folder.uri, folderConfiguration);
|
|
810
|
-
if (this.getWorkbenchState() ===
|
|
809
|
+
if (this.getWorkbenchState() === 2 ) {
|
|
811
810
|
const workspaceConfigurationChange = this._configuration.compareAndUpdateWorkspaceConfiguration(folderConfiguration);
|
|
812
|
-
this.triggerConfigurationChange(mergeChanges(folderConfigurationChange, workspaceConfigurationChange), previous,
|
|
811
|
+
this.triggerConfigurationChange(mergeChanges(folderConfigurationChange, workspaceConfigurationChange), previous, 5 );
|
|
813
812
|
}
|
|
814
813
|
else {
|
|
815
|
-
this.triggerConfigurationChange(folderConfigurationChange, previous,
|
|
814
|
+
this.triggerConfigurationChange(folderConfigurationChange, previous, 6 );
|
|
816
815
|
}
|
|
817
816
|
this.updateRestrictedSettings();
|
|
818
817
|
}
|
|
@@ -885,10 +884,10 @@ class WorkspaceService extends Disposable {
|
|
|
885
884
|
'Cannot write configuration because the configuration service is not yet ready to accept writes.'
|
|
886
885
|
)));
|
|
887
886
|
}
|
|
888
|
-
if (target ===
|
|
887
|
+
if (target === 7 ) {
|
|
889
888
|
throw ( (new Error('Invalid configuration target')));
|
|
890
889
|
}
|
|
891
|
-
if (target ===
|
|
890
|
+
if (target === 8 ) {
|
|
892
891
|
const previous = { data: this._configuration.toData(), workspace: this.workspace };
|
|
893
892
|
this._configuration.updateValue(key, value, overrides);
|
|
894
893
|
this.triggerConfigurationChange({ keys: overrides?.overrideIdentifiers?.length ? [keyFromOverrideIdentifiers(overrides.overrideIdentifiers), key] : [key], overrides: overrides?.overrideIdentifiers?.length ? ( (overrides.overrideIdentifiers.map(overrideIdentifier => ([overrideIdentifier, [key]])))) : [] }, previous, target);
|
|
@@ -898,7 +897,7 @@ class WorkspaceService extends Disposable {
|
|
|
898
897
|
if (!editableConfigurationTarget) {
|
|
899
898
|
throw ( (new Error('Invalid configuration target')));
|
|
900
899
|
}
|
|
901
|
-
if (editableConfigurationTarget ===
|
|
900
|
+
if (editableConfigurationTarget === 2 && !this.remoteUserConfiguration) {
|
|
902
901
|
throw ( (new Error('Invalid configuration target')));
|
|
903
902
|
}
|
|
904
903
|
if (overrides?.overrideIdentifiers?.length && overrides.overrideIdentifiers.length > 1) {
|
|
@@ -914,7 +913,7 @@ class WorkspaceService extends Disposable {
|
|
|
914
913
|
this.configurationEditing = this.configurationEditing ?? this.createConfigurationEditingService(this.instantiationService);
|
|
915
914
|
await (await this.configurationEditing).writeConfiguration(editableConfigurationTarget, { key, value }, { scopes: overrides, ...options });
|
|
916
915
|
switch (editableConfigurationTarget) {
|
|
917
|
-
case
|
|
916
|
+
case 1 :
|
|
918
917
|
if (this.applicationConfiguration && this.isSettingAppliedForAllProfiles(key)) {
|
|
919
918
|
await this.reloadApplicationConfiguration();
|
|
920
919
|
}
|
|
@@ -922,11 +921,11 @@ class WorkspaceService extends Disposable {
|
|
|
922
921
|
await this.reloadLocalUserConfiguration();
|
|
923
922
|
}
|
|
924
923
|
return;
|
|
925
|
-
case
|
|
924
|
+
case 2 :
|
|
926
925
|
return this.reloadRemoteUserConfiguration().then(() => undefined);
|
|
927
|
-
case
|
|
926
|
+
case 3 :
|
|
928
927
|
return this.reloadWorkspaceConfiguration();
|
|
929
|
-
case
|
|
928
|
+
case 4 : {
|
|
930
929
|
const workspaceFolder = overrides && overrides.resource ? this.workspace.getFolder(overrides.resource) : null;
|
|
931
930
|
if (workspaceFolder) {
|
|
932
931
|
return this.reloadWorkspaceFolderConfiguration(workspaceFolder);
|
|
@@ -940,18 +939,18 @@ class WorkspaceService extends Disposable {
|
|
|
940
939
|
}
|
|
941
940
|
getConfigurationModelForEditableConfigurationTarget(target, resource) {
|
|
942
941
|
switch (target) {
|
|
943
|
-
case
|
|
944
|
-
case
|
|
945
|
-
case
|
|
946
|
-
case
|
|
942
|
+
case 1 : return this._configuration.localUserConfiguration;
|
|
943
|
+
case 2 : return this._configuration.remoteUserConfiguration;
|
|
944
|
+
case 3 : return this._configuration.workspaceConfiguration;
|
|
945
|
+
case 4 : return resource ? this._configuration.folderConfigurations.get(resource) : undefined;
|
|
947
946
|
}
|
|
948
947
|
}
|
|
949
948
|
getConfigurationModel(target, resource) {
|
|
950
949
|
switch (target) {
|
|
951
|
-
case
|
|
952
|
-
case
|
|
953
|
-
case
|
|
954
|
-
case
|
|
950
|
+
case 3 : return this._configuration.localUserConfiguration;
|
|
951
|
+
case 4 : return this._configuration.remoteUserConfiguration;
|
|
952
|
+
case 5 : return this._configuration.workspaceConfiguration;
|
|
953
|
+
case 6 : return resource ? this._configuration.folderConfigurations.get(resource) : undefined;
|
|
955
954
|
default: return undefined;
|
|
956
955
|
}
|
|
957
956
|
}
|
|
@@ -961,28 +960,28 @@ class WorkspaceService extends Disposable {
|
|
|
961
960
|
}
|
|
962
961
|
const definedTargets = [];
|
|
963
962
|
if (inspect.workspaceFolderValue !== undefined) {
|
|
964
|
-
definedTargets.push(
|
|
963
|
+
definedTargets.push(6 );
|
|
965
964
|
}
|
|
966
965
|
if (inspect.workspaceValue !== undefined) {
|
|
967
|
-
definedTargets.push(
|
|
966
|
+
definedTargets.push(5 );
|
|
968
967
|
}
|
|
969
968
|
if (inspect.userRemoteValue !== undefined) {
|
|
970
|
-
definedTargets.push(
|
|
969
|
+
definedTargets.push(4 );
|
|
971
970
|
}
|
|
972
971
|
if (inspect.userLocalValue !== undefined) {
|
|
973
|
-
definedTargets.push(
|
|
972
|
+
definedTargets.push(3 );
|
|
974
973
|
}
|
|
975
974
|
if (inspect.applicationValue !== undefined) {
|
|
976
|
-
definedTargets.push(
|
|
975
|
+
definedTargets.push(1 );
|
|
977
976
|
}
|
|
978
977
|
if (value === undefined) {
|
|
979
978
|
return definedTargets;
|
|
980
979
|
}
|
|
981
|
-
return [definedTargets[0] ||
|
|
980
|
+
return [definedTargets[0] || 2 ];
|
|
982
981
|
}
|
|
983
982
|
triggerConfigurationChange(change, previous, target) {
|
|
984
983
|
if (change.keys.length) {
|
|
985
|
-
if (target !==
|
|
984
|
+
if (target !== 7 ) {
|
|
986
985
|
this.logService.debug(`Configuration keys changed in ${ConfigurationTargetToString(target)} target`, ...change.keys);
|
|
987
986
|
}
|
|
988
987
|
const configurationChangeEvent = ( (new ConfigurationChangeEvent(change, previous, this._configuration, this.workspace, this.logService)));
|
|
@@ -991,32 +990,32 @@ class WorkspaceService extends Disposable {
|
|
|
991
990
|
}
|
|
992
991
|
}
|
|
993
992
|
toEditableConfigurationTarget(target, key) {
|
|
994
|
-
if (target ===
|
|
995
|
-
return
|
|
993
|
+
if (target === 1 ) {
|
|
994
|
+
return 1 ;
|
|
996
995
|
}
|
|
997
|
-
if (target ===
|
|
996
|
+
if (target === 2 ) {
|
|
998
997
|
if (this.remoteUserConfiguration) {
|
|
999
998
|
const scope = this.configurationRegistry.getConfigurationProperties()[key]?.scope;
|
|
1000
|
-
if (scope ===
|
|
1001
|
-
return
|
|
999
|
+
if (scope === 2 || scope === 6 ) {
|
|
1000
|
+
return 2 ;
|
|
1002
1001
|
}
|
|
1003
1002
|
if (this.inspect(key).userRemoteValue !== undefined) {
|
|
1004
|
-
return
|
|
1003
|
+
return 2 ;
|
|
1005
1004
|
}
|
|
1006
1005
|
}
|
|
1007
|
-
return
|
|
1006
|
+
return 1 ;
|
|
1008
1007
|
}
|
|
1009
|
-
if (target ===
|
|
1010
|
-
return
|
|
1008
|
+
if (target === 3 ) {
|
|
1009
|
+
return 1 ;
|
|
1011
1010
|
}
|
|
1012
|
-
if (target ===
|
|
1013
|
-
return
|
|
1011
|
+
if (target === 4 ) {
|
|
1012
|
+
return 2 ;
|
|
1014
1013
|
}
|
|
1015
|
-
if (target ===
|
|
1016
|
-
return
|
|
1014
|
+
if (target === 5 ) {
|
|
1015
|
+
return 3 ;
|
|
1017
1016
|
}
|
|
1018
|
-
if (target ===
|
|
1019
|
-
return
|
|
1017
|
+
if (target === 6 ) {
|
|
1018
|
+
return 4 ;
|
|
1020
1019
|
}
|
|
1021
1020
|
return null;
|
|
1022
1021
|
}
|
|
@@ -1031,7 +1030,7 @@ let RegisterConfigurationSchemasContribution = class RegisterConfigurationSchema
|
|
|
1031
1030
|
this.registerConfigurationSchemas();
|
|
1032
1031
|
const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
|
|
1033
1032
|
const delayer = this._register(( (new Delayer(50))));
|
|
1034
|
-
this._register(Event.any(configurationRegistry.onDidUpdateConfiguration, configurationRegistry.onDidSchemaChange, workspaceTrustManagementService.onDidChangeTrust)(() => delayer.trigger(() => this.registerConfigurationSchemas(), lifecycleService.phase ===
|
|
1033
|
+
this._register(Event.any(configurationRegistry.onDidUpdateConfiguration, configurationRegistry.onDidSchemaChange, workspaceTrustManagementService.onDidChangeTrust)(() => delayer.trigger(() => this.registerConfigurationSchemas(), lifecycleService.phase === 4 ? undefined : 2500 )));
|
|
1035
1034
|
});
|
|
1036
1035
|
}
|
|
1037
1036
|
registerConfigurationSchemas() {
|
|
@@ -1085,7 +1084,7 @@ let RegisterConfigurationSchemasContribution = class RegisterConfigurationSchema
|
|
|
1085
1084
|
allowTrailingCommas: true,
|
|
1086
1085
|
allowComments: true
|
|
1087
1086
|
};
|
|
1088
|
-
const folderSettingsSchema =
|
|
1087
|
+
const folderSettingsSchema = 3 === this.workspaceContextService.getWorkbenchState() ?
|
|
1089
1088
|
{
|
|
1090
1089
|
properties: Object.assign({}, this.checkAndFilterPropertiesRequiringTrust(machineOverridableSettings.properties), this.checkAndFilterPropertiesRequiringTrust(resourceSettings.properties)),
|
|
1091
1090
|
patternProperties: allSettings.patternProperties,
|
|
@@ -1095,7 +1094,7 @@ let RegisterConfigurationSchemasContribution = class RegisterConfigurationSchema
|
|
|
1095
1094
|
} : workspaceSettingsSchema;
|
|
1096
1095
|
const configDefaultsSchema = {
|
|
1097
1096
|
type: 'object',
|
|
1098
|
-
description: ( localize(
|
|
1097
|
+
description: ( localize(3681, 'Contribute defaults for configurations')),
|
|
1099
1098
|
properties: Object.assign({}, this.filterDefaultOverridableProperties(machineOverridableSettings.properties), this.filterDefaultOverridableProperties(windowSettings.properties), this.filterDefaultOverridableProperties(resourceSettings.properties)),
|
|
1100
1099
|
patternProperties: {
|
|
1101
1100
|
[OVERRIDE_PROPERTY_PATTERN]: {
|
|
@@ -1159,7 +1158,7 @@ let ResetConfigurationDefaultsOverridesCache = class ResetConfigurationDefaultsO
|
|
|
1159
1158
|
constructor(configurationService, extensionService) {
|
|
1160
1159
|
super();
|
|
1161
1160
|
if (configurationService.hasCachedConfigurationDefaultsOverrides()) {
|
|
1162
|
-
extensionService.whenInstalledExtensionsRegistered().then(() => configurationService.reloadConfiguration(
|
|
1161
|
+
extensionService.whenInstalledExtensionsRegistered().then(() => configurationService.reloadConfiguration(7 ));
|
|
1163
1162
|
}
|
|
1164
1163
|
}
|
|
1165
1164
|
};
|
|
@@ -1206,18 +1205,18 @@ UpdateExperimentalSettingsDefaults = ( (__decorate([
|
|
|
1206
1205
|
( (__param(0, IWorkbenchAssignmentService)))
|
|
1207
1206
|
], UpdateExperimentalSettingsDefaults)));
|
|
1208
1207
|
const workbenchContributionsRegistry = ( (Registry.as(Extensions$2.Workbench)));
|
|
1209
|
-
workbenchContributionsRegistry.registerWorkbenchContribution(RegisterConfigurationSchemasContribution,
|
|
1210
|
-
workbenchContributionsRegistry.registerWorkbenchContribution(ResetConfigurationDefaultsOverridesCache,
|
|
1211
|
-
registerWorkbenchContribution2(UpdateExperimentalSettingsDefaults.ID, UpdateExperimentalSettingsDefaults,
|
|
1208
|
+
workbenchContributionsRegistry.registerWorkbenchContribution(RegisterConfigurationSchemasContribution, 3 );
|
|
1209
|
+
workbenchContributionsRegistry.registerWorkbenchContribution(ResetConfigurationDefaultsOverridesCache, 4 );
|
|
1210
|
+
registerWorkbenchContribution2(UpdateExperimentalSettingsDefaults.ID, UpdateExperimentalSettingsDefaults, 2 );
|
|
1212
1211
|
const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
|
|
1213
1212
|
configurationRegistry.registerConfiguration({
|
|
1214
1213
|
...workbenchConfigurationNodeBase,
|
|
1215
1214
|
properties: {
|
|
1216
1215
|
[APPLY_ALL_PROFILES_SETTING]: {
|
|
1217
1216
|
'type': 'array',
|
|
1218
|
-
description: ( localize(
|
|
1217
|
+
description: ( localize(3682, "Configure settings to be applied for all profiles.")),
|
|
1219
1218
|
'default': [],
|
|
1220
|
-
'scope':
|
|
1219
|
+
'scope': 1 ,
|
|
1221
1220
|
additionalProperties: true,
|
|
1222
1221
|
uniqueItems: true,
|
|
1223
1222
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { FileOperationResult } from 'vscode/vscode/vs/platform/files/common/files';
|
|
2
1
|
import { joinPath } from 'vscode/vscode/vs/base/common/resources';
|
|
3
2
|
import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
|
|
4
3
|
import { Queue } from 'vscode/vscode/vs/base/common/async';
|
|
@@ -61,7 +60,7 @@ class CachedConfiguration {
|
|
|
61
60
|
await this.queue.queue(() => this.fileService.del(this.cachedConfigurationFolderResource, { recursive: true, useTrash: false }));
|
|
62
61
|
}
|
|
63
62
|
catch (error) {
|
|
64
|
-
if (error.fileOperationResult !==
|
|
63
|
+
if (error.fileOperationResult !== 1 ) {
|
|
65
64
|
throw error;
|
|
66
65
|
}
|
|
67
66
|
}
|