Skip to content

Commit ca3dd8c

Browse files
authored
1 parent 414b609 commit ca3dd8c

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/vs/workbench/contrib/extensions/browser/extensionsActions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ import { ActionWithDropdownActionViewItem, IActionWithDropdownActionViewItemOpti
7474
import { IAuthenticationUsageService } from '../../../services/authentication/browser/authenticationUsageService.js';
7575
import { IExtensionGalleryManifestService } from '../../../../platform/extensionManagement/common/extensionGalleryManifest.js';
7676
import { IWorkbenchIssueService } from '../../issue/common/issue.js';
77+
import { IUserDataProfilesService } from '../../../../platform/userDataProfile/common/userDataProfile.js';
7778

7879
export class PromptExtensionInstallFailureAction extends Action {
7980

@@ -893,6 +894,7 @@ export class UninstallAction extends ExtensionAction {
893894

894895
constructor(
895896
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
897+
@IUserDataProfilesService private readonly userDataProfilesService: IUserDataProfilesService,
896898
@IDialogService private readonly dialogService: IDialogService
897899
) {
898900
super('extensions.uninstall', UninstallAction.UninstallLabel, UninstallAction.UninstallClass, false);
@@ -914,7 +916,7 @@ export class UninstallAction extends ExtensionAction {
914916
return;
915917
}
916918

917-
this.label = UninstallAction.UninstallLabel;
919+
this.label = this.extension.local?.isApplicationScoped && this.userDataProfilesService.profiles.length > 1 ? localize('uninstallAll', "Uninstall (All Profiles)") : UninstallAction.UninstallLabel;
918920
this.class = UninstallAction.UninstallClass;
919921
this.tooltip = UninstallAction.UninstallLabel;
920922

src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ import { IQuickInputService } from '../../../../platform/quickinput/common/quick
7272
import { IMarkdownString, MarkdownString } from '../../../../base/common/htmlContent.js';
7373
import { ExtensionGalleryResourceType, getExtensionGalleryManifestResourceUri, IExtensionGalleryManifestService } from '../../../../platform/extensionManagement/common/extensionGalleryManifest.js';
7474
import { fromNow } from '../../../../base/common/date.js';
75+
import { IUserDataProfilesService } from '../../../../platform/userDataProfile/common/userDataProfile.js';
7576

7677
interface IExtensionStateProvider<T> {
7778
(extension: Extension): T;
@@ -961,6 +962,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
961962
@ILifecycleService private readonly lifecycleService: ILifecycleService,
962963
@IFileService private readonly fileService: IFileService,
963964
@IUserDataProfileService private readonly userDataProfileService: IUserDataProfileService,
965+
@IUserDataProfilesService private readonly userDataProfilesService: IUserDataProfilesService,
964966
@IStorageService private readonly storageService: IStorageService,
965967
@IDialogService private readonly dialogService: IDialogService,
966968
@IUserDataSyncEnablementService private readonly userDataSyncEnablementService: IUserDataSyncEnablementService,
@@ -2599,6 +2601,18 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
25992601
throw new Error('Missing local');
26002602
}
26012603

2604+
if (extension.local.isApplicationScoped && this.userDataProfilesService.profiles.length > 1) {
2605+
const { confirmed } = await this.dialogService.confirm({
2606+
title: nls.localize('uninstallApplicationScoped', "Uninstall Extension"),
2607+
type: Severity.Info,
2608+
message: nls.localize('uninstallApplicationScopedMessage', "Would you like to Uninstall {0} from all profiles?", extension.displayName),
2609+
primaryButton: nls.localize('uninstallAllProfiles', "Uninstall (All Profiles)")
2610+
});
2611+
if (!confirmed) {
2612+
throw new CancellationError();
2613+
}
2614+
}
2615+
26022616
const extensionsToUninstall: UninstallExtensionInfo[] = [{ extension: extension.local }];
26032617
for (const packExtension of this.getAllPackedExtensions(extension, this.local)) {
26042618
if (packExtension.local && !extensionsToUninstall.some(e => areSameExtensions(e.extension.identifier, packExtension.identifier))) {

0 commit comments

Comments
 (0)