@@ -15,7 +15,7 @@ import { ConfigurationModel, ConfigurationChangeEvent, mergeChanges } from 'vs/p
1515import { IConfigurationChangeEvent , ConfigurationTarget , IConfigurationOverrides , isConfigurationOverrides , IConfigurationData , IConfigurationValue , IConfigurationChange , ConfigurationTargetToString , IConfigurationUpdateOverrides , isConfigurationUpdateOverrides , IConfigurationService , IConfigurationUpdateOptions } from 'vs/platform/configuration/common/configuration' ;
1616import { IPolicyConfiguration , NullPolicyConfiguration , PolicyConfiguration } from 'vs/platform/configuration/common/configurations' ;
1717import { Configuration } from 'vs/workbench/services/configuration/common/configurationModels' ;
18- import { FOLDER_CONFIG_FOLDER_NAME , defaultSettingsSchemaId , userSettingsSchemaId , workspaceSettingsSchemaId , folderSettingsSchemaId , IConfigurationCache , machineSettingsSchemaId , LOCAL_MACHINE_SCOPES , IWorkbenchConfigurationService , RestrictedSettings , PROFILE_SCOPES , LOCAL_MACHINE_PROFILE_SCOPES , profileSettingsSchemaId , APPLY_ALL_PROFILES_SETTING } from 'vs/workbench/services/configuration/common/configuration' ;
18+ import { FOLDER_CONFIG_FOLDER_NAME , defaultSettingsSchemaId , userSettingsSchemaId , workspaceSettingsSchemaId , folderSettingsSchemaId , IConfigurationCache , machineSettingsSchemaId , LOCAL_MACHINE_SCOPES , IWorkbenchConfigurationService , RestrictedSettings , PROFILE_SCOPES , LOCAL_MACHINE_PROFILE_SCOPES , profileSettingsSchemaId } from 'vs/workbench/services/configuration/common/configuration' ;
1919import { Registry } from 'vs/platform/registry/common/platform' ;
2020import { IConfigurationRegistry , Extensions , allSettings , windowSettings , resourceSettings , applicationSettings , machineSettings , machineOverridableSettings , ConfigurationScope , IConfigurationPropertySchema , keyFromOverrideIdentifiers , OVERRIDE_PROPERTY_PATTERN , resourceLanguageSettingsSchemaId , configurationDefaultsSchemaId } from 'vs/platform/configuration/common/configurationRegistry' ;
2121import { IStoredWorkspaceFolder , isStoredWorkspaceFolder , IWorkspaceFolderCreationData , getStoredWorkspaceFolder , toWorkspaceFolders } from 'vs/platform/workspaces/common/workspaces' ;
@@ -44,7 +44,6 @@ import { IPolicyService, NullPolicyService } from 'vs/platform/policy/common/pol
4444import { IUserDataProfile , IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile' ;
4545import { IJSONEditingService } from 'vs/workbench/services/configuration/common/jsonEditing' ;
4646import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService' ;
47- import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuration' ;
4847
4948function getLocalUserConfigurationScopes ( userDataProfile : IUserDataProfile , hasRemote : boolean ) : ConfigurationScope [ ] | undefined {
5049 return userDataProfile . isDefault
@@ -490,11 +489,7 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
490489 }
491490
492491 isSettingAppliedForAllProfiles ( key : string ) : boolean {
493- if ( this . configurationRegistry . getConfigurationProperties ( ) [ key ] ?. scope === ConfigurationScope . APPLICATION ) {
494- return true ;
495- }
496- const allProfilesSettings = this . getValue < string [ ] > ( APPLY_ALL_PROFILES_SETTING ) ?? [ ] ;
497- return Array . isArray ( allProfilesSettings ) && allProfilesSettings . includes ( key ) ;
492+ return this . configurationRegistry . getConfigurationProperties ( ) [ key ] ?. scope === ConfigurationScope . APPLICATION ;
498493 }
499494
500495 private async createWorkspace ( arg : IAnyWorkspaceIdentifier ) : Promise < Workspace > {
@@ -606,10 +601,6 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
606601 const initUserConfiguration = async ( ) => {
607602 mark ( 'code/willInitUserConfiguration' ) ;
608603 const result = await Promise . all ( [ this . localUserConfiguration . initialize ( ) , this . remoteUserConfiguration ? this . remoteUserConfiguration . initialize ( ) : Promise . resolve ( new ConfigurationModel ( ) ) ] ) ;
609- if ( this . applicationConfiguration ) {
610- const applicationConfigurationModel = await initApplicationConfigurationPromise ;
611- result [ 0 ] = this . localUserConfiguration . reparse ( { exclude : applicationConfigurationModel . getValue ( APPLY_ALL_PROFILES_SETTING ) } ) ;
612- }
613604 mark ( 'code/didInitUserConfiguration' ) ;
614605 return result ;
615606 } ;
@@ -723,12 +714,8 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
723714 promises . push ( this . reloadApplicationConfiguration ( true ) ) ;
724715 }
725716 }
726- let [ localUser , application ] = await Promise . all ( promises ) ;
727- application = application ?? this . _configuration . applicationConfiguration ;
728- if ( this . applicationConfiguration ) {
729- localUser = this . localUserConfiguration . reparse ( { exclude : application . getValue ( APPLY_ALL_PROFILES_SETTING ) } ) ;
730- }
731- await this . loadConfiguration ( application , localUser , this . _configuration . remoteUserConfiguration , true ) ;
717+ const [ localUser , application ] = await Promise . all ( promises ) ;
718+ await this . loadConfiguration ( application ?? this . _configuration . applicationConfiguration , localUser , this . _configuration . remoteUserConfiguration , true ) ;
732719 } ) ( ) ) ;
733720 }
734721
@@ -771,35 +758,15 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
771758
772759 private onApplicationConfigurationChanged ( applicationConfiguration : ConfigurationModel ) : void {
773760 const previous = { data : this . _configuration . toData ( ) , workspace : this . workspace } ;
774- const previousAllProfilesSettings = this . _configuration . applicationConfiguration . getValue < string [ ] > ( APPLY_ALL_PROFILES_SETTING ) ?? [ ] ;
775761 const change = this . _configuration . compareAndUpdateApplicationConfiguration ( applicationConfiguration ) ;
776- const currentAllProfilesSettings = this . getValue < string [ ] > ( APPLY_ALL_PROFILES_SETTING ) ?? [ ] ;
777762 const configurationProperties = this . configurationRegistry . getConfigurationProperties ( ) ;
778763 const changedKeys : string [ ] = [ ] ;
779764 for ( const changedKey of change . keys ) {
780765 if ( configurationProperties [ changedKey ] ?. scope === ConfigurationScope . APPLICATION ) {
781766 changedKeys . push ( changedKey ) ;
782- if ( changedKey === APPLY_ALL_PROFILES_SETTING ) {
783- for ( const previousAllProfileSetting of previousAllProfilesSettings ) {
784- if ( ! currentAllProfilesSettings . includes ( previousAllProfileSetting ) ) {
785- changedKeys . push ( previousAllProfileSetting ) ;
786- }
787- }
788- for ( const currentAllProfileSetting of currentAllProfilesSettings ) {
789- if ( ! previousAllProfilesSettings . includes ( currentAllProfileSetting ) ) {
790- changedKeys . push ( currentAllProfileSetting ) ;
791- }
792- }
793- }
794- }
795- else if ( currentAllProfilesSettings . includes ( changedKey ) ) {
796- changedKeys . push ( changedKey ) ;
797767 }
798768 }
799769 change . keys = changedKeys ;
800- if ( change . keys . includes ( APPLY_ALL_PROFILES_SETTING ) ) {
801- this . _configuration . updateLocalUserConfiguration ( this . localUserConfiguration . reparse ( { exclude : currentAllProfilesSettings } ) ) ;
802- }
803770 this . triggerConfigurationChange ( change , previous , ConfigurationTarget . USER ) ;
804771 }
805772
@@ -1351,18 +1318,3 @@ const workbenchContributionsRegistry = Registry.as<IWorkbenchContributionsRegist
13511318workbenchContributionsRegistry . registerWorkbenchContribution ( RegisterConfigurationSchemasContribution , LifecyclePhase . Restored ) ;
13521319workbenchContributionsRegistry . registerWorkbenchContribution ( ResetConfigurationDefaultsOverridesCache , LifecyclePhase . Eventually ) ;
13531320workbenchContributionsRegistry . registerWorkbenchContribution ( UpdateExperimentalSettingsDefaults , LifecyclePhase . Restored ) ;
1354-
1355- const configurationRegistry = Registry . as < IConfigurationRegistry > ( Extensions . Configuration ) ;
1356- configurationRegistry . registerConfiguration ( {
1357- ...workbenchConfigurationNodeBase ,
1358- properties : {
1359- [ APPLY_ALL_PROFILES_SETTING ] : {
1360- 'type' : 'array' ,
1361- description : localize ( 'setting description' , "Configure settings to be applied for all profiles." ) ,
1362- 'default' : [ ] ,
1363- 'scope' : ConfigurationScope . APPLICATION ,
1364- additionalProperties : true ,
1365- uniqueItems : true ,
1366- }
1367- }
1368- } ) ;
0 commit comments