Skip to content

Commit 9f3a7b5

Browse files
authored
1 parent b7a9323 commit 9f3a7b5

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,6 @@ class Extensions extends Disposable {
585585
@IExtensionGalleryService private readonly galleryService: IExtensionGalleryService,
586586
@IWorkbenchExtensionEnablementService private readonly extensionEnablementService: IWorkbenchExtensionEnablementService,
587587
@IWorkbenchExtensionManagementService private readonly workbenchExtensionManagementService: IWorkbenchExtensionManagementService,
588-
@IUserDataProfileService private readonly userDataProfileService: IUserDataProfileService,
589588
@ITelemetryService private readonly telemetryService: ITelemetryService,
590589
@IInstantiationService private readonly instantiationService: IInstantiationService
591590
) {
@@ -716,7 +715,7 @@ class Extensions extends Disposable {
716715
const galleryWithLocalVersion: IGalleryExtension | undefined = (await this.galleryService.getExtensions([{ ...localExtension.identifier, version: localExtension.manifest.version }], CancellationToken.None))[0];
717716
isPreReleaseVersion = !!galleryWithLocalVersion?.properties?.isPreReleaseVersion;
718717
}
719-
return this.server.extensionManagementService.updateMetadata(localExtension, { id: gallery.identifier.uuid, publisherDisplayName: gallery.publisherDisplayName, publisherId: gallery.publisherId, isPreReleaseVersion }, this.userDataProfileService.currentProfile.extensionsResource);
718+
return this.workbenchExtensionManagementService.updateMetadata(localExtension, { id: gallery.identifier.uuid, publisherDisplayName: gallery.publisherDisplayName, publisherId: gallery.publisherId, isPreReleaseVersion });
720719
}
721720

722721
canInstall(galleryExtension: IGalleryExtension): Promise<boolean> {

src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import { IExtensionsScannerService, IScannedExtension } from '../../../../platfo
4141
import { IStorageService, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js';
4242
import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.js';
4343
import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';
44+
import { IUserDataProfilesService } from '../../../../platform/userDataProfile/common/userDataProfile.js';
4445

4546
function isGalleryExtension(extension: IResourceExtension | IGalleryExtension): extension is IGalleryExtension {
4647
return extension.type === 'gallery';
@@ -84,6 +85,7 @@ export class ExtensionManagementService extends Disposable implements IWorkbench
8485
@IExtensionManagementServerService protected readonly extensionManagementServerService: IExtensionManagementServerService,
8586
@IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService,
8687
@IUserDataProfileService private readonly userDataProfileService: IUserDataProfileService,
88+
@IUserDataProfilesService private readonly userDataProfilesService: IUserDataProfilesService,
8789
@IConfigurationService protected readonly configurationService: IConfigurationService,
8890
@IProductService protected readonly productService: IProductService,
8991
@IDownloadService protected readonly downloadService: IDownloadService,
@@ -265,7 +267,8 @@ export class ExtensionManagementService extends Disposable implements IWorkbench
265267
updateMetadata(extension: ILocalExtension, metadata: Partial<Metadata>): Promise<ILocalExtension> {
266268
const server = this.getServer(extension);
267269
if (server) {
268-
return server.extensionManagementService.updateMetadata(extension, metadata, this.userDataProfileService.currentProfile.extensionsResource);
270+
const profile = extension.isApplicationScoped ? this.userDataProfilesService.defaultProfile : this.userDataProfileService.currentProfile;
271+
return server.extensionManagementService.updateMetadata(extension, metadata, profile.extensionsResource);
269272
}
270273
return Promise.reject(`Invalid location ${extension.location.toString()}`);
271274
}

src/vs/workbench/services/extensionManagement/electron-sandbox/extensionManagementService.ts

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { ILogService } from '../../../../platform/log/common/log.js';
2525
import { IUserDataProfileService } from '../../userDataProfile/common/userDataProfile.js';
2626
import { IExtensionsScannerService } from '../../../../platform/extensionManagement/common/extensionsScannerService.js';
2727
import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';
28+
import { IUserDataProfilesService } from '../../../../platform/userDataProfile/common/userDataProfile.js';
2829

2930
export class ExtensionManagementService extends BaseExtensionManagementService {
3031

@@ -33,6 +34,7 @@ export class ExtensionManagementService extends BaseExtensionManagementService {
3334
@IExtensionManagementServerService extensionManagementServerService: IExtensionManagementServerService,
3435
@IExtensionGalleryService extensionGalleryService: IExtensionGalleryService,
3536
@IUserDataProfileService userDataProfileService: IUserDataProfileService,
37+
@IUserDataProfilesService userDataProfilesService: IUserDataProfilesService,
3638
@IConfigurationService configurationService: IConfigurationService,
3739
@IProductService productService: IProductService,
3840
@IDownloadService downloadService: IDownloadService,
@@ -50,6 +52,7 @@ export class ExtensionManagementService extends BaseExtensionManagementService {
5052
extensionManagementServerService,
5153
extensionGalleryService,
5254
userDataProfileService,
55+
userDataProfilesService,
5356
configurationService,
5457
productService,
5558
downloadService,

0 commit comments

Comments
 (0)