src/vs/platform/extensionManagement/common/extensionManagementCLIService.ts/ExtensionManagementCLIService/getGalleryExtensions
class ExtensionManagementCLIService:	private async getGalleryExtensions(extensions: InstallExtensionInfo[]): Promise<Map<string, IGalleryExtension>> {
		const extensionIds = extensions.filter(({ version }) => version === undefined).map(({ id }) => id);
		const extensionsWithIdAndVersion = extensions.filter(({ version }) => version !== undefined);

		const galleryExtensions = new Map<string, IGalleryExtension>();
		await Promise.all([
			(async () => {
				const result = await this.extensionGalleryService.getExtensions(extensionIds, CancellationToken.None);
				result.forEach(extension => galleryExtensions.set(extension.identifier.id.toLowerCase(), extension));
			})(),
			Promise.all(extensionsWithIdAndVersion.map(async ({ id, version }) => {
				const extension = await this.extensionGalleryService.getCompatibleExtension({ id }, version);
				if (extension) {
					galleryExtensions.set(extension.identifier.id.toLowerCase(), extension);
				}
			}))
		]);

		return galleryExtensions;
	}