@@ -757,7 +757,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
757757 version : this . productService . version ,
758758 date : this . productService . date
759759 }
760- } , false ) ;
760+ } , undefined , extensionInfo . preRelease ? 'prerelease' : 'release' ) ;
761761
762762 if ( extension ) {
763763 result . push ( extension ) ;
@@ -990,7 +990,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
990990 if ( hasAllVersions ) {
991991 const extensions : IGalleryExtension [ ] = [ ] ;
992992 for ( const rawGalleryExtension of rawGalleryExtensions ) {
993- const extension = await this . toGalleryExtensionWithCriteria ( rawGalleryExtension , criteria , true , context ) ;
993+ const extension = await this . toGalleryExtensionWithCriteria ( rawGalleryExtension , criteria , context ) ;
994994 if ( extension ) {
995995 extensions . push ( extension ) ;
996996 }
@@ -1019,7 +1019,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
10191019 continue ;
10201020 }
10211021 }
1022- const extension = await this . toGalleryExtensionWithCriteria ( rawGalleryExtension , criteria , false , context ) ;
1022+ const extension = await this . toGalleryExtensionWithCriteria ( rawGalleryExtension , criteria , context ) ;
10231023 if ( ! extension
10241024 /** Need all versions if the extension is a pre-release version but
10251025 * - the query is to look for a release version or
@@ -1060,7 +1060,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
10601060 return { extensions : result . sort ( ( a , b ) => a [ 0 ] - b [ 0 ] ) . map ( ( [ , extension ] ) => extension ) , total } ;
10611061 }
10621062
1063- private async toGalleryExtensionWithCriteria ( rawGalleryExtension : IRawGalleryExtension , criteria : IExtensionCriteria , hasAllVersions : boolean , queryContext ?: IStringDictionary < any > ) : Promise < IGalleryExtension | null > {
1063+ private async toGalleryExtensionWithCriteria ( rawGalleryExtension : IRawGalleryExtension , criteria : IExtensionCriteria , queryContext ?: IStringDictionary < any > , versionType ?: 'release' | 'prerelease' | 'any' ) : Promise < IGalleryExtension | null > {
10641064
10651065 const extensionIdentifier = { id : getGalleryExtensionId ( rawGalleryExtension . publisher . publisherName , rawGalleryExtension . extensionName ) , uuid : rawGalleryExtension . extensionId } ;
10661066 const version = criteria . versions ?. find ( extensionIdentifierWithVersion => areSameExtensions ( extensionIdentifierWithVersion , extensionIdentifier ) ) ?. version ;
@@ -1082,7 +1082,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
10821082 extensionIdentifier . id ,
10831083 rawGalleryExtensionVersion ,
10841084 rawGalleryExtension . publisher . displayName ,
1085- includePreRelease ? ( hasAllVersions ? 'any' : 'prerelease' ) : ' release',
1085+ versionType ?? ( includePreRelease ? 'any' : 'release' ) ,
10861086 criteria . compatible ,
10871087 allTargetPlatforms ,
10881088 criteria . targetPlatform ,
0 commit comments