From e1f27e691f5f9118555d361dcdd54df257de69ca Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 26 Jan 2024 13:19:43 +0100 Subject: [PATCH] fix #203523 (#203524) --- .../node/extensionManagementService.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index c7137910f44..905dec7cd90 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -599,7 +599,13 @@ export class ExtensionsScanner extends Disposable { metadata = { ...source?.metadata, ...metadata }; if (target) { - await this.extensionsProfileScannerService.updateMetadata([[extension, { ...target.metadata, ...metadata }]], toProfileLocation); + if (this.uriIdentityService.extUri.isEqual(target.location, extension.location)) { + await this.extensionsProfileScannerService.updateMetadata([[extension, { ...target.metadata, ...metadata }]], toProfileLocation); + } else { + const targetExtension = await this.scanLocalExtension(target.location, extension.type, toProfileLocation); + await this.extensionsProfileScannerService.removeExtensionFromProfile(targetExtension, toProfileLocation); + await this.extensionsProfileScannerService.addExtensionsToProfile([[extension, { ...target.metadata, ...metadata }]], toProfileLocation); + } } else { await this.extensionsProfileScannerService.addExtensionsToProfile([[extension, metadata]], toProfileLocation); }