@@ -118,7 +118,7 @@ export abstract class AbstractExtensionManagementService extends Disposable impl
118
118
119
119
await Promise . allSettled ( extensions . map ( async ( { extension, options } ) => {
120
120
try {
121
- const compatible = await this . checkAndGetCompatibleVersion ( extension , ! ! options ?. installGivenVersion , ! ! options ?. installPreReleaseVersion ) ;
121
+ const compatible = await this . checkAndGetCompatibleVersion ( extension , ! ! options ?. installGivenVersion , ! ! options ?. installPreReleaseVersion , false ) ;
122
122
installableExtensions . push ( { ...compatible , options } ) ;
123
123
} catch ( error ) {
124
124
results . push ( { identifier : extension . identifier , operation : InstallOperation . Install , source : extension , error } ) ;
@@ -434,7 +434,7 @@ export abstract class AbstractExtensionManagementService extends Disposable impl
434
434
const isDependency = dependecies . some ( id => areSameExtensions ( { id } , galleryExtension . identifier ) ) ;
435
435
let compatible ;
436
436
try {
437
- compatible = await this . checkAndGetCompatibleVersion ( galleryExtension , false , installPreRelease ) ;
437
+ compatible = await this . checkAndGetCompatibleVersion ( galleryExtension , false , installPreRelease , true ) ;
438
438
} catch ( error ) {
439
439
if ( ! isDependency ) {
440
440
this . logService . info ( 'Skipping the packed extension as it cannot be installed' , galleryExtension . identifier . id , getErrorMessage ( error ) ) ;
@@ -454,7 +454,7 @@ export abstract class AbstractExtensionManagementService extends Disposable impl
454
454
return allDependenciesAndPacks ;
455
455
}
456
456
457
- private async checkAndGetCompatibleVersion ( extension : IGalleryExtension , sameVersion : boolean , installPreRelease : boolean ) : Promise < { extension : IGalleryExtension ; manifest : IExtensionManifest } > {
457
+ private async checkAndGetCompatibleVersion ( extension : IGalleryExtension , sameVersion : boolean , installPreRelease : boolean , fallbackToRelease : boolean ) : Promise < { extension : IGalleryExtension ; manifest : IExtensionManifest } > {
458
458
const extensionsControlManifest = await this . getExtensionsControlManifest ( ) ;
459
459
if ( extensionsControlManifest . malicious . some ( identifier => areSameExtensions ( extension . identifier , identifier ) ) ) {
460
460
throw new ExtensionManagementError ( nls . localize ( 'malicious extension' , "Can't install '{0}' extension since it was reported to be problematic." , extension . identifier . id ) , ExtensionManagementErrorCode . Malicious ) ;
@@ -467,7 +467,7 @@ export abstract class AbstractExtensionManagementService extends Disposable impl
467
467
468
468
const compatibleExtension = await this . getCompatibleVersion ( extension , sameVersion , installPreRelease ) ;
469
469
if ( compatibleExtension ) {
470
- if ( installPreRelease && ! sameVersion && extension . hasPreReleaseVersion && ! compatibleExtension . properties . isPreReleaseVersion ) {
470
+ if ( ! fallbackToRelease && installPreRelease && ! sameVersion && extension . hasPreReleaseVersion && ! compatibleExtension . properties . isPreReleaseVersion ) {
471
471
throw new ExtensionManagementError ( nls . localize ( 'notFoundCompatiblePrereleaseDependency' , "Can't install pre-release version of '{0}' extension because it is not compatible with the current version of {1} (version {2})." , extension . identifier . id , this . productService . nameLong , this . productService . version ) , ExtensionManagementErrorCode . IncompatiblePreRelease ) ;
472
472
}
473
473
} else {
0 commit comments