src/vs/platform/extensionManagement/common/extensionGalleryService.ts/ExtensionGalleryService/getCompatibleExtensionByEngine
class ExtensionGalleryService:	private async getCompatibleExtensionByEngine(arg1: IExtensionIdentifier | IGalleryExtension, version?: string): Promise<IGalleryExtension | null> {
		const extension: IGalleryExtension | null = isIExtensionIdentifier(arg1) ? null : arg1;
		if (extension && extension.properties.engine && isEngineValid(extension.properties.engine, this.productService.version, this.productService.date)) {
			return extension;
		}
		const { id, uuid } = extension ? extension.identifier : <IExtensionIdentifier>arg1;
		let query = new Query()
			.withFlags(Flags.IncludeAssetUri, Flags.IncludeStatistics, Flags.IncludeCategoryAndTags, Flags.IncludeFiles, Flags.IncludeVersionProperties)
			.withPage(1, 1)
			.withFilter(FilterType.Target, 'Microsoft.VisualStudio.Code');

		if (uuid) {
			query = query.withFilter(FilterType.ExtensionId, uuid);
		} else {
			query = query.withFilter(FilterType.ExtensionName, id);
		}

		const { galleryExtensions } = await this.queryGallery(query, CancellationToken.None);
		const [rawExtension] = galleryExtensions;
		if (!rawExtension || !rawExtension.versions.length) {
			return null;
		}

		if (version) {
			const versionAsset = rawExtension.versions.filter(v => v.version === version)[0];
			if (versionAsset) {
				const extension = toExtension(rawExtension, versionAsset, 0, query);
				if (extension.properties.engine && isEngineValid(extension.properties.engine, this.productService.version, this.productService.date)) {
					return extension;
				}
			}
			return null;
		}

		const rawVersion = await this.getLastValidExtensionVersion(rawExtension, rawExtension.versions);
		if (rawVersion) {
			return toExtension(rawExtension, rawVersion, 0, query);
		}
		return null;
	}