@@ -647,6 +647,36 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
647
647
async getExtensions ( extensionInfos : ReadonlyArray < IExtensionInfo > , arg1 : any , arg2 ?: any ) : Promise < IGalleryExtension [ ] > {
648
648
const options = CancellationToken . isCancellationToken ( arg1 ) ? { } : arg1 as IExtensionQueryOptions ;
649
649
const token = CancellationToken . isCancellationToken ( arg1 ) ? arg1 : arg2 as CancellationToken ;
650
+ const result = await this . doGetExtensions ( extensionInfos , options , token ) ;
651
+
652
+ const uuids = result . map ( r => r . identifier . uuid ) ;
653
+ const extensionInfosByName : IExtensionInfo [ ] = [ ] ;
654
+ for ( const e of extensionInfos ) {
655
+ if ( e . uuid && ! uuids . includes ( e . uuid ) ) {
656
+ extensionInfosByName . push ( { ...e , uuid : undefined } ) ;
657
+ }
658
+ }
659
+
660
+ if ( extensionInfosByName . length ) {
661
+ // report telemetry data for additional query
662
+ this . telemetryService . publicLog2 <
663
+ { count : number } ,
664
+ {
665
+ owner : 'sandy081' ;
666
+ comment : 'Report the query to the the Marketplace for fetching extensions by name' ;
667
+ readonly count : { classification : 'SystemMetaData' ; purpose : 'FeatureInsight' ; comment : 'Number of extensions to fetch' } ;
668
+ } > ( 'galleryService:additionalQueryByName' , {
669
+ count : extensionInfosByName . length
670
+ } ) ;
671
+
672
+ const extensions = await this . doGetExtensions ( extensionInfosByName , options , token ) ;
673
+ result . push ( ...extensions ) ;
674
+ }
675
+
676
+ return result ;
677
+ }
678
+
679
+ private async doGetExtensions ( extensionInfos : ReadonlyArray < IExtensionInfo > , options : IExtensionQueryOptions , token : CancellationToken ) : Promise < IGalleryExtension [ ] > {
650
680
const names : string [ ] = [ ] ; const ids : string [ ] = [ ] , includePreReleases : ( IExtensionIdentifier & { includePreRelease : boolean } ) [ ] = [ ] , versions : ( IExtensionIdentifier & { version : string } ) [ ] = [ ] ;
651
681
let isQueryForReleaseVersionFromPreReleaseVersion = true ;
652
682
for ( const extensionInfo of extensionInfos ) {
0 commit comments