Skip to content

Commit

Permalink
fail installing extensions not compatible with the engine (#990)
Browse files Browse the repository at this point in the history
  • Loading branch information
llali authored and kburtram committed Mar 26, 2018
1 parent 2f8f606 commit 0de5d7a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down Expand Up @@ -239,7 +239,8 @@ export class ExtensionManagementService implements IExtensionManagementService {
return this.galleryService.loadCompatibleVersion(extension)
.then(compatible => {
if (!compatible) {
return TPromise.wrapError<IGalleryExtension[]>(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<IGalleryExtension[]>(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(
Expand Down
13 changes: 4 additions & 9 deletions src/vs/platform/extensions/node/extensionValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0de5d7a

Please sign in to comment.