Fix extension install version check (#13436)

This commit is contained in:
Charles Gagnon
2020-11-17 09:58:50 -08:00
committed by GitHub
parent 39e1181c5d
commit 6cd2d6c942

View File

@@ -161,8 +161,11 @@ export class ExtensionManagementService extends Disposable implements IExtension
const identifier = { id: getGalleryExtensionId(manifest.publisher, manifest.name) };
// let operation: InstallOperation = InstallOperation.Install; {{ SQL CARBON EDIT }}
// {{ SQL CARBON EDIT }}
if (manifest.engines && ((manifest.engines.vscode && !isEngineValid(manifest.engines.vscode, product.vscodeVersion)) || (manifest.engines.azdata && !isEngineValid(manifest.engines.azdata, product.version)))) {
throw new Error(nls.localize('incompatible', "Unable to install extension '{0}' as it is not compatible with VS Code '{1}'.", identifier.id, product.version));
if (manifest.engines?.vscode && !isEngineValid(manifest.engines.vscode, product.vscodeVersion)) {
throw new Error(nls.localize('incompatible', "Unable to install extension '{0}' as it is not compatible with the current VS Code engine version '{1}'.", identifier.id, product.vscodeVersion));
}
if (manifest.engines?.azdata && !isEngineValid(manifest.engines.azdata, product.version)) {
throw new Error(nls.localize('incompatibleAzdata', "Unable to install extension '{0}' as it is not compatible with Azure Data Studio '{1}'.", identifier.id, product.version));
}
const identifierWithVersion = new ExtensionIdentifierWithVersion(identifier, manifest.version);