@@ -15,7 +15,7 @@ import { ConfigurationModel, ConfigurationChangeEvent, mergeChanges } from 'vs/p
15
15
import { IConfigurationChangeEvent , ConfigurationTarget , IConfigurationOverrides , isConfigurationOverrides , IConfigurationData , IConfigurationValue , IConfigurationChange , ConfigurationTargetToString , IConfigurationUpdateOverrides , isConfigurationUpdateOverrides , IConfigurationService , IConfigurationUpdateOptions } from 'vs/platform/configuration/common/configuration' ;
16
16
import { IPolicyConfiguration , NullPolicyConfiguration , PolicyConfiguration } from 'vs/platform/configuration/common/configurations' ;
17
17
import { 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' ;
19
19
import { Registry } from 'vs/platform/registry/common/platform' ;
20
20
import { IConfigurationRegistry , Extensions , allSettings , windowSettings , resourceSettings , applicationSettings , machineSettings , machineOverridableSettings , ConfigurationScope , IConfigurationPropertySchema , keyFromOverrideIdentifiers , OVERRIDE_PROPERTY_PATTERN , resourceLanguageSettingsSchemaId , configurationDefaultsSchemaId } from 'vs/platform/configuration/common/configurationRegistry' ;
21
21
import { IStoredWorkspaceFolder , isStoredWorkspaceFolder , IWorkspaceFolderCreationData , getStoredWorkspaceFolder , toWorkspaceFolders } from 'vs/platform/workspaces/common/workspaces' ;
@@ -44,7 +44,6 @@ import { IPolicyService, NullPolicyService } from 'vs/platform/policy/common/pol
44
44
import { IUserDataProfile , IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile' ;
45
45
import { IJSONEditingService } from 'vs/workbench/services/configuration/common/jsonEditing' ;
46
46
import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService' ;
47
- import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuration' ;
48
47
49
48
function getLocalUserConfigurationScopes ( userDataProfile : IUserDataProfile , hasRemote : boolean ) : ConfigurationScope [ ] | undefined {
50
49
return userDataProfile . isDefault
@@ -490,11 +489,7 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
490
489
}
491
490
492
491
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 ;
498
493
}
499
494
500
495
private async createWorkspace ( arg : IAnyWorkspaceIdentifier ) : Promise < Workspace > {
@@ -606,10 +601,6 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
606
601
const initUserConfiguration = async ( ) => {
607
602
mark ( 'code/willInitUserConfiguration' ) ;
608
603
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
- }
613
604
mark ( 'code/didInitUserConfiguration' ) ;
614
605
return result ;
615
606
} ;
@@ -723,12 +714,8 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
723
714
promises . push ( this . reloadApplicationConfiguration ( true ) ) ;
724
715
}
725
716
}
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 ) ;
732
719
} ) ( ) ) ;
733
720
}
734
721
@@ -771,35 +758,15 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
771
758
772
759
private onApplicationConfigurationChanged ( applicationConfiguration : ConfigurationModel ) : void {
773
760
const previous = { data : this . _configuration . toData ( ) , workspace : this . workspace } ;
774
- const previousAllProfilesSettings = this . _configuration . applicationConfiguration . getValue < string [ ] > ( APPLY_ALL_PROFILES_SETTING ) ?? [ ] ;
775
761
const change = this . _configuration . compareAndUpdateApplicationConfiguration ( applicationConfiguration ) ;
776
- const currentAllProfilesSettings = this . getValue < string [ ] > ( APPLY_ALL_PROFILES_SETTING ) ?? [ ] ;
777
762
const configurationProperties = this . configurationRegistry . getConfigurationProperties ( ) ;
778
763
const changedKeys : string [ ] = [ ] ;
779
764
for ( const changedKey of change . keys ) {
780
765
if ( configurationProperties [ changedKey ] ?. scope === ConfigurationScope . APPLICATION ) {
781
766
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 ) ;
797
767
}
798
768
}
799
769
change . keys = changedKeys ;
800
- if ( change . keys . includes ( APPLY_ALL_PROFILES_SETTING ) ) {
801
- this . _configuration . updateLocalUserConfiguration ( this . localUserConfiguration . reparse ( { exclude : currentAllProfilesSettings } ) ) ;
802
- }
803
770
this . triggerConfigurationChange ( change , previous , ConfigurationTarget . USER ) ;
804
771
}
805
772
@@ -1351,18 +1318,3 @@ const workbenchContributionsRegistry = Registry.as<IWorkbenchContributionsRegist
1351
1318
workbenchContributionsRegistry . registerWorkbenchContribution ( RegisterConfigurationSchemasContribution , LifecyclePhase . Restored ) ;
1352
1319
workbenchContributionsRegistry . registerWorkbenchContribution ( ResetConfigurationDefaultsOverridesCache , LifecyclePhase . Eventually ) ;
1353
1320
workbenchContributionsRegistry . 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