From 7a4fa25ce631857933da0c501658fa3117ff5f5a Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 9 Jan 2025 16:12:05 +0100 Subject: [PATCH] simpler recovery fix for #237551 (#237579) --- .../common/extensionGalleryService.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts index eb73323d84bb2..e20397e39502e 100644 --- a/src/vs/platform/extensionManagement/common/extensionGalleryService.ts +++ b/src/vs/platform/extensionManagement/common/extensionGalleryService.ts @@ -757,7 +757,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi version: this.productService.version, date: this.productService.date } - }, false); + }, undefined, extensionInfo.preRelease ? 'prerelease' : 'release'); if (extension) { result.push(extension); @@ -990,7 +990,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi if (hasAllVersions) { const extensions: IGalleryExtension[] = []; for (const rawGalleryExtension of rawGalleryExtensions) { - const extension = await this.toGalleryExtensionWithCriteria(rawGalleryExtension, criteria, true, context); + const extension = await this.toGalleryExtensionWithCriteria(rawGalleryExtension, criteria, context); if (extension) { extensions.push(extension); } @@ -1019,7 +1019,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi continue; } } - const extension = await this.toGalleryExtensionWithCriteria(rawGalleryExtension, criteria, false, context); + const extension = await this.toGalleryExtensionWithCriteria(rawGalleryExtension, criteria, context); if (!extension /** Need all versions if the extension is a pre-release version but * - the query is to look for a release version or @@ -1060,7 +1060,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi return { extensions: result.sort((a, b) => a[0] - b[0]).map(([, extension]) => extension), total }; } - private async toGalleryExtensionWithCriteria(rawGalleryExtension: IRawGalleryExtension, criteria: IExtensionCriteria, hasAllVersions: boolean, queryContext?: IStringDictionary): Promise { + private async toGalleryExtensionWithCriteria(rawGalleryExtension: IRawGalleryExtension, criteria: IExtensionCriteria, queryContext?: IStringDictionary, versionType?: 'release' | 'prerelease' | 'any'): Promise { const extensionIdentifier = { id: getGalleryExtensionId(rawGalleryExtension.publisher.publisherName, rawGalleryExtension.extensionName), uuid: rawGalleryExtension.extensionId }; const version = criteria.versions?.find(extensionIdentifierWithVersion => areSameExtensions(extensionIdentifierWithVersion, extensionIdentifier))?.version; @@ -1082,7 +1082,7 @@ abstract class AbstractExtensionGalleryService implements IExtensionGalleryServi extensionIdentifier.id, rawGalleryExtensionVersion, rawGalleryExtension.publisher.displayName, - includePreRelease ? (hasAllVersions ? 'any' : 'prerelease') : 'release', + versionType ?? (includePreRelease ? 'any' : 'release'), criteria.compatible, allTargetPlatforms, criteria.targetPlatform,