From c125687c4dc87efbcaec462bb3e770e8c1de53d8 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 19 May 2023 16:43:39 +0200 Subject: [PATCH] Adopt new extension host restart lifecycle #180514 (#182967) Adopt Adopt new extension host restart lifecycle #180514 --- .../userDataProfile/browser/userDataProfileManagement.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.ts b/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.ts index 44ca40c9fdf..798d14dce33 100644 --- a/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.ts +++ b/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { CancellationError } from 'vs/base/common/errors'; import { Disposable } from 'vs/base/common/lifecycle'; import { localize } from 'vs/nls'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; @@ -117,7 +118,9 @@ export class UserDataProfileManagementService extends Disposable implements IUse const isRemoteWindow = !!this.environmentService.remoteAuthority; if (!isRemoteWindow) { - this.extensionService.stopExtensionHosts(true); // TODO@sandy081 adopt support for extension host to veto stopping + if (!(await this.extensionService.stopExtensionHosts(localize('switch profile', "Switching Profile")))) { + throw new CancellationError(); + } } // In a remote window update current profile before reloading so that data is preserved from current profile if asked to preserve