From 3f502b2bcff29d983b67c5a145ad10524c080d49 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 28 Jul 2022 08:56:31 +0200 Subject: Fix #154485 (#156533) --- .../browser/userDataProfileManagement.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/vs') diff --git a/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.ts b/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.ts index 5fab982a11c..7b124b207ca 100644 --- a/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.ts +++ b/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.ts @@ -87,7 +87,16 @@ export class UserDataProfileManagementService extends Disposable implements IUse } private async enterProfile(profile: IUserDataProfile, preserveData: boolean, reloadMessage?: string): Promise { - if (this.environmentService.remoteAuthority) { + const isRemoteWindow = !!this.environmentService.remoteAuthority; + + if (!isRemoteWindow) { + this.extensionService.stopExtensionHosts(); + } + + // In a remote window update current profile before reloading so that data is preserved from current profile if asked to preserve + await this.userDataProfileService.updateCurrentProfile(profile, preserveData); + + if (isRemoteWindow) { const result = await this.dialogService.confirm({ type: 'info', message: reloadMessage ?? localize('reload message', "Switching a settings profile requires reloading VS Code."), @@ -96,12 +105,9 @@ export class UserDataProfileManagementService extends Disposable implements IUse if (result.confirmed) { await this.hostService.reload(); } - return; + } else { + await this.extensionService.startExtensionHosts(); } - - this.extensionService.stopExtensionHosts(); - await this.userDataProfileService.updateCurrentProfile(profile, preserveData); - await this.extensionService.startExtensionHosts(); } } -- cgit v1.2.3