src/vs/platform/extensionManagement/node/extensionManagementService.ts/ExtensionManagementService/installFromGallery
class ExtensionManagementService:	async installFromGallery(extension: IGalleryExtension, options: InstallOptions = {}): Promise<ILocalExtension> {
		if (!this.galleryService.isEnabled()) {
			throw new Error(nls.localize('MarketPlaceDisabled', "Marketplace is not enabled"));
		}

		try {
			extension = await this.checkAndGetCompatibleVersion(extension);
		} catch (error) {
			const errorCode = error && (<ExtensionManagementError>error).code ? (<ExtensionManagementError>error).code : ERROR_UNKNOWN;
			this.logService.error(`Failed to install extension:`, extension.identifier.id, error ? error.message : errorCode);
			this.reportTelemetry(this.getTelemetryEvent(InstallOperation.Install), getGalleryExtensionTelemetryData(extension), undefined, error);
			if (error instanceof Error) {
				error.name = errorCode;
			}
			throw error;
		}

		let installExtensionTask = this.installingExtensions.get(new ExtensionIdentifierWithVersion(extension.identifier, extension.version).key());
		if (installExtensionTask) {
			this.logService.info('Extensions is already requested to install', extension.identifier.id);
			return (await installExtensionTask.resultPromise).local;
		} else {
			installExtensionTask = this.createInstallFromGalleryExtensionTask(extension, options);
			return (await this.runInstallGalleryExtensionTask(installExtensionTask, options)).local;
		}
	}