Skip to content

Commit 3f502b2

Browse files
authored
1 parent c4d9909 commit 3f502b2

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,16 @@ export class UserDataProfileManagementService extends Disposable implements IUse
8787
}
8888

8989
private async enterProfile(profile: IUserDataProfile, preserveData: boolean, reloadMessage?: string): Promise<void> {
90-
if (this.environmentService.remoteAuthority) {
90+
const isRemoteWindow = !!this.environmentService.remoteAuthority;
91+
92+
if (!isRemoteWindow) {
93+
this.extensionService.stopExtensionHosts();
94+
}
95+
96+
// In a remote window update current profile before reloading so that data is preserved from current profile if asked to preserve
97+
await this.userDataProfileService.updateCurrentProfile(profile, preserveData);
98+
99+
if (isRemoteWindow) {
91100
const result = await this.dialogService.confirm({
92101
type: 'info',
93102
message: reloadMessage ?? localize('reload message', "Switching a settings profile requires reloading VS Code."),
@@ -96,12 +105,9 @@ export class UserDataProfileManagementService extends Disposable implements IUse
96105
if (result.confirmed) {
97106
await this.hostService.reload();
98107
}
99-
return;
108+
} else {
109+
await this.extensionService.startExtensionHosts();
100110
}
101-
102-
this.extensionService.stopExtensionHosts();
103-
await this.userDataProfileService.updateCurrentProfile(profile, preserveData);
104-
await this.extensionService.startExtensionHosts();
105111
}
106112
}
107113

0 commit comments

Comments
 (0)