Skip to content

Commit 23188a4

Browse files
authored
1 parent 84495ce commit 23188a4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,23 +1480,23 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
14801480

14811481
async installInServer(extension: IExtension, server: IExtensionManagementServer): Promise<void> {
14821482
await this.doInstall(extension, async () => {
1483+
const local = extension.local;
1484+
if (!local) {
1485+
throw new Error('Extension not found');
1486+
}
14831487
if (!extension.gallery) {
1484-
extension = (await this.getExtensions([extension.identifier], CancellationToken.None))[0] ?? extension;
1488+
extension = (await this.getExtensions([{ ...extension.identifier, preRelease: local.preRelease }], CancellationToken.None))[0] ?? extension;
14851489
}
14861490
if (extension.gallery) {
1487-
return server.extensionManagementService.installFromGallery(extension.gallery);
1488-
}
1489-
1490-
if (!extension.local) {
1491-
throw new Error('Extension not found');
1491+
return server.extensionManagementService.installFromGallery(extension.gallery, { installPreReleaseVersion: local.preRelease });
14921492
}
14931493

14941494
const targetPlatform = await server.extensionManagementService.getTargetPlatform();
1495-
if (!isTargetPlatformCompatible(extension.local.targetPlatform, [extension.local.targetPlatform], targetPlatform)) {
1495+
if (!isTargetPlatformCompatible(local.targetPlatform, [local.targetPlatform], targetPlatform)) {
14961496
throw new Error(nls.localize('incompatible', "Can't install '{0}' extension because it is not compatible.", extension.identifier.id));
14971497
}
14981498

1499-
const vsix = await this.extensionManagementService.zip(extension.local);
1499+
const vsix = await this.extensionManagementService.zip(local);
15001500
try {
15011501
return await server.extensionManagementService.install(vsix);
15021502
} finally {

0 commit comments

Comments
 (0)