@@ -1480,23 +1480,23 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
1480
1480
1481
1481
async installInServer ( extension : IExtension , server : IExtensionManagementServer ) : Promise < void > {
1482
1482
await this . doInstall ( extension , async ( ) => {
1483
+ const local = extension . local ;
1484
+ if ( ! local ) {
1485
+ throw new Error ( 'Extension not found' ) ;
1486
+ }
1483
1487
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 ;
1485
1489
}
1486
1490
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 } ) ;
1492
1492
}
1493
1493
1494
1494
const targetPlatform = await server . extensionManagementService . getTargetPlatform ( ) ;
1495
- if ( ! isTargetPlatformCompatible ( extension . local . targetPlatform , [ extension . local . targetPlatform ] , targetPlatform ) ) {
1495
+ if ( ! isTargetPlatformCompatible ( local . targetPlatform , [ local . targetPlatform ] , targetPlatform ) ) {
1496
1496
throw new Error ( nls . localize ( 'incompatible' , "Can't install '{0}' extension because it is not compatible." , extension . identifier . id ) ) ;
1497
1497
}
1498
1498
1499
- const vsix = await this . extensionManagementService . zip ( extension . local ) ;
1499
+ const vsix = await this . extensionManagementService . zip ( local ) ;
1500
1500
try {
1501
1501
return await server . extensionManagementService . install ( vsix ) ;
1502
1502
} finally {
0 commit comments