Merge from vscode a5cf1da01d5db3d2557132be8d30f89c38019f6c (#8525)

* Merge from vscode a5cf1da01d5db3d2557132be8d30f89c38019f6c

* remove files we don't want

* fix hygiene

* update distro

* update distro

* fix hygiene

* fix strict nulls

* distro

* distro

* fix tests

* fix tests

* add another edit

* fix viewlet icon

* fix azure dialog

* fix some padding

* fix more padding issues
This commit is contained in:
Anthony Dresser
2019-12-04 19:28:22 -08:00
committed by GitHub
parent a8818ab0df
commit f5ce7fb2a5
1507 changed files with 42813 additions and 27370 deletions

View File

@@ -153,7 +153,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
this.logService.trace('ExtensionManagementService#zip', extension.identifier.id);
return this.collectFiles(extension)
.then(files => zip(path.join(tmpdir(), generateUuid()), files))
.then(path => URI.file(path));
.then<URI>(path => URI.file(path));
}
unzip(zipLocation: URI, type: ExtensionType): Promise<IExtensionIdentifier> {
@@ -222,6 +222,16 @@ export class ExtensionManagementService extends Disposable implements IExtension
} else if (semver.gt(existing.manifest.version, manifest.version)) {
return this.uninstall(existing, true);
}
} else {
// Remove the extension with same version if it is already uninstalled.
// Installing a VSIX extension shall replace the existing extension always.
return this.unsetUninstalledAndGetLocal(identifierWithVersion)
.then(existing => {
if (existing) {
return this.removeExtension(existing, 'existing').then(null, e => Promise.reject(new Error(nls.localize('restartCode', "Please restart Azure Data Studio before reinstalling {0}.", manifest.displayName || manifest.name))));
}
return undefined;
});
}
return undefined;
})
@@ -390,7 +400,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
return this.setUninstalled(extension)
.then(() => this.removeUninstalledExtension(extension)
.then(
() => this.installFromGallery(galleryExtension),
() => this.installFromGallery(galleryExtension).then(),
e => Promise.reject(new Error(nls.localize('removeError', "Error while removing the extension: {0}. Please Quit and Start VS Code before trying again.", toErrorMessage(e))))));
}
return Promise.reject(new Error(nls.localize('Not a Marketplace extension', "Only Marketplace Extensions can be reinstalled")));
@@ -541,10 +551,10 @@ export class ExtensionManagementService extends Disposable implements IExtension
.then(galleryResult => {
const extensionsToInstall = galleryResult.firstPage;
return Promise.all(extensionsToInstall.map(e => this.installFromGallery(e)))
.then(() => null, errors => this.rollback(extensionsToInstall).then(() => Promise.reject(errors), () => Promise.reject(errors)));
.then(undefined, errors => this.rollback(extensionsToInstall).then(() => Promise.reject(errors), () => Promise.reject(errors)));
});
}
return null;
return undefined; // {{SQL CARBON EDIT}} strict-null-checks
});
}
}
@@ -565,7 +575,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
.then(installed => {
const extensionToUninstall = installed.filter(e => areSameExtensions(e.identifier, extension.identifier))[0];
if (extensionToUninstall) {
return this.checkForDependenciesAndUninstall(extensionToUninstall, installed).then(() => null, error => Promise.reject(this.joinErrors(error)));
return this.checkForDependenciesAndUninstall(extensionToUninstall, installed).then(undefined, error => Promise.reject(this.joinErrors(error)));
} else {
return Promise.reject(new Error(nls.localize('notInstalled', "Extension '{0}' is not installed.", extension.manifest.displayName || extension.manifest.name)));
}