@@ -73,8 +73,8 @@ export class UserDataProfilesMainService extends UserDataProfilesService impleme
73
73
return this . profiles . profiles ;
74
74
}
75
75
76
- override getProfile ( workspace : URI ) : IUserDataProfile {
77
- return this . profiles . workspaces . get ( workspace ) ?? this . defaultProfile ;
76
+ override getProfile ( workspaceIdentifier : ISingleFolderWorkspaceIdentifier | IWorkspaceIdentifier ) : IUserDataProfile {
77
+ return this . profiles . workspaces . get ( this . getWorkspace ( workspaceIdentifier ) ) ?? this . defaultProfile ;
78
78
}
79
79
80
80
override async createProfile ( profile : IUserDataProfile , options : ProfileOptions , workspaceIdentifier ?: ISingleFolderWorkspaceIdentifier | IWorkspaceIdentifier ) : Promise < IUserDataProfile > {
@@ -93,7 +93,7 @@ export class UserDataProfilesMainService extends UserDataProfilesService impleme
93
93
94
94
override async setProfileForWorkspace ( profile : IUserDataProfile , workspaceIdentifier : ISingleFolderWorkspaceIdentifier | IWorkspaceIdentifier ) : Promise < IUserDataProfile > {
95
95
profile = reviveProfile ( profile , this . profilesHome . scheme ) ;
96
- const workspace = isSingleFolderWorkspaceIdentifier ( workspaceIdentifier ) ? workspaceIdentifier . uri : workspaceIdentifier . configPath ;
96
+ const workspace = this . getWorkspace ( workspaceIdentifier ) ;
97
97
const storedWorkspaceInfos = this . storedWorskpaceInfos . filter ( info => ! this . uriIdentityService . extUri . isEqual ( info . workspace , workspace ) ) ;
98
98
if ( ! profile . isDefault ) {
99
99
storedWorkspaceInfos . push ( { workspace, profile : profile . location } ) ;
@@ -102,6 +102,10 @@ export class UserDataProfilesMainService extends UserDataProfilesService impleme
102
102
return this . profiles . profiles . find ( p => this . uriIdentityService . extUri . isEqual ( p . location , profile . location ) ) ! ;
103
103
}
104
104
105
+ private getWorkspace ( workspaceIdentifier : ISingleFolderWorkspaceIdentifier | IWorkspaceIdentifier ) {
106
+ return isSingleFolderWorkspaceIdentifier ( workspaceIdentifier ) ? workspaceIdentifier . uri : workspaceIdentifier . configPath ;
107
+ }
108
+
105
109
override async removeProfile ( profile : IUserDataProfile ) : Promise < void > {
106
110
if ( profile . isDefault ) {
107
111
throw new Error ( 'Cannot remove default profile' ) ;
0 commit comments