From 0de5d7a96a1e224d477bbb6b0ef74137d18d3e31 Mon Sep 17 00:00:00 2001 From: Leila Lali Date: Mon, 26 Mar 2018 14:00:30 -0700 Subject: [PATCH] fail installing extensions not compatible with the engine (#990) --- .../node/extensionManagementService.ts | 5 +++-- .../platform/extensions/node/extensionValidator.ts | 13 ++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index 5d8a2dbcac71..361d10192c47 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -154,7 +154,7 @@ export class ExtensionManagementService implements IExtensionManagementService { .then(validated => { if (validated) { this._onInstallExtension.fire({ identifier, zipPath }); - + // {{SQL CARBON EDIT}} // Until there's a gallery for SQL Ops Studio, skip retrieving the metadata from the gallery return this.installExtension({ zipPath, id: identifier.id, metadata: null }) @@ -239,7 +239,8 @@ export class ExtensionManagementService implements IExtensionManagementService { return this.galleryService.loadCompatibleVersion(extension) .then(compatible => { if (!compatible) { - return TPromise.wrapError(new InstallationError(nls.localize('notFoundCompatible', "Unable to install because, the extension '{0}' compatible with current version '{1}' of VS Code is not found.", extension.identifier.id, pkg.version), INSTALL_ERROR_INCOMPATIBLE)); + // {{SQL CARBON EDIT}} + return TPromise.wrapError(new InstallationError(nls.localize('notFoundCompatible', "Unable to install because, the extension '{0}' compatible with current version '{1}' of SQL Operations Studio is not found.", extension.identifier.id, pkg.version), INSTALL_ERROR_INCOMPATIBLE)); } return this.getDependenciesToInstall(compatible.properties.dependencies) .then( diff --git a/src/vs/platform/extensions/node/extensionValidator.ts b/src/vs/platform/extensions/node/extensionValidator.ts index 82a3f682383e..efbdbb63d1f4 100644 --- a/src/vs/platform/extensions/node/extensionValidator.ts +++ b/src/vs/platform/extensions/node/extensionValidator.ts @@ -247,16 +247,11 @@ export function isVersionValid(currentVersion: string, requestedVersion: string, } } - // {{SQL CARBON EDIT}} - //TODO: Currently the validation happens with the vscode engine version. - // We will have to have sqlops engine version in package.json instead and compare - // with that - - //if (!isValidVersion(currentVersion, desiredVersion)) { - // notices.push(nls.localize('versionMismatch', "Extension is not compatible with Code {0}. Extension requires: {1}.", currentVersion, requestedVersion)); - // return false; - //} + if (!isValidVersion(currentVersion, desiredVersion)) { + notices.push(nls.localize('versionMismatch', "Extension is not compatible with Code {0}. Extension requires: {1}.", currentVersion, requestedVersion)); + return false; + } return true; }