src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts/ExtensionsWorkbenchService/installFromGallery
class ExtensionsWorkbenchService:	private async installFromGallery(extension: IExtension, gallery: IGalleryExtension, installOptions?: InstallOptions): Promise<IExtension> {
		this.installing.push(extension);
		this._onChange.fire(extension);
		try {
			if (extension.state === ExtensionState.Installed && extension.local) {
				await this.extensionManagementService.updateFromGallery(gallery, extension.local);
			} else {
				await this.extensionManagementService.installFromGallery(gallery, installOptions);
			}
			const ids: string[] | undefined = extension.identifier.uuid ? [extension.identifier.uuid] : undefined;
			const names: string[] | undefined = extension.identifier.uuid ? undefined : [extension.identifier.id];
			this.queryGallery({ names, ids, pageSize: 1 }, CancellationToken.None);
			return this.local.filter(local => areSameExtensions(local.identifier, gallery.identifier))[0];
		} finally {
			this.installing = this.installing.filter(e => e !== extension);
			this._onChange.fire(this.local.filter(e => areSameExtensions(e.identifier, extension.identifier))[0]);
		}
	}