Skip to content

Commit 6f88621

Browse files
authored
download the extensions locally while installing failed remote extensions from workbench (microsoft#241719)
1 parent f64fab0 commit 6f88621

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/vs/platform/extensionManagement/common/extensionManagement.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,7 @@ export type InstallOptions = {
537537
installOnlyNewlyAddedFromExtensionPack?: boolean;
538538
productVersion?: IProductVersion;
539539
keepExisting?: boolean;
540+
downloadExtensionsLocally?: boolean;
540541
/**
541542
* Context passed through to InstallExtensionResult
542543
*/

src/vs/workbench/contrib/extensions/electron-sandbox/remoteExtensionsInit.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,19 @@ export class InstallFailedRemoteExtensionsContribution implements IWorkbenchCont
5959
for (const { id, installOptions } of failed) {
6060
const extension = galleryExtensions.find(e => areSameExtensions(e.identifier, { id }));
6161
if (extension) {
62-
installExtensionInfo.push({ extension, options: installOptions });
62+
installExtensionInfo.push({
63+
extension, options: {
64+
...installOptions,
65+
downloadExtensionsLocally: true,
66+
}
67+
});
6368
} else {
6469
this.logService.warn(`Relayed failed extension '${id}' from server is not found in the gallery`);
6570
}
6671
}
6772

6873
if (installExtensionInfo.length) {
69-
await this.extensionManagementServerService.remoteExtensionManagementServer.extensionManagementService.installGalleryExtensions(installExtensionInfo);
74+
await Promise.allSettled(installExtensionInfo.map(e => this.extensionManagementServerService.remoteExtensionManagementServer!.extensionManagementService.installFromGallery(e.extension, e.options)));
7075
}
7176
}
7277
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class NativeRemoteExtensionManagementService extends RemoteExtensionManag
6464
}
6565

6666
private async doInstallFromGallery(extension: IGalleryExtension, installOptions: InstallOptions): Promise<ILocalExtension> {
67-
if (this.configurationService.getValue('remote.downloadExtensionsLocally')) {
67+
if (installOptions.downloadExtensionsLocally || this.configurationService.getValue('remote.downloadExtensionsLocally')) {
6868
return this.downloadAndInstall(extension, installOptions);
6969
}
7070
try {

0 commit comments

Comments
 (0)