Skip to content

Commit 1f28297

Browse files
authored
1 parent af676cd commit 1f28297

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/vs/platform/extensionManagement/common/extensionGalleryService.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,36 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi
647647
async getExtensions(extensionInfos: ReadonlyArray<IExtensionInfo>, arg1: any, arg2?: any): Promise<IGalleryExtension[]> {
648648
const options = CancellationToken.isCancellationToken(arg1) ? {} : arg1 as IExtensionQueryOptions;
649649
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[]> {
650680
const names: string[] = []; const ids: string[] = [], includePreReleases: (IExtensionIdentifier & { includePreRelease: boolean })[] = [], versions: (IExtensionIdentifier & { version: string })[] = [];
651681
let isQueryForReleaseVersionFromPreReleaseVersion = true;
652682
for (const extensionInfo of extensionInfos) {

0 commit comments

Comments
 (0)