src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts/ExtensionsWorkbenchService/fromGallery
class ExtensionsWorkbenchService:	private fromGallery(gallery: IGalleryExtension, maliciousExtensionSet: Set<string>): IExtension {
		Promise.all([
			this.localExtensions ? this.localExtensions.syncLocalWithGalleryExtension(gallery, maliciousExtensionSet) : Promise.resolve(false),
			this.remoteExtensions ? this.remoteExtensions.syncLocalWithGalleryExtension(gallery, maliciousExtensionSet) : Promise.resolve(false),
			this.webExtensions ? this.webExtensions.syncLocalWithGalleryExtension(gallery, maliciousExtensionSet) : Promise.resolve(false)
		])
			.then(result => {
				if (result[0] || result[1]) {
					this.eventuallyAutoUpdateExtensions();
				}
			});

		const installed = this.getInstalledExtensionMatchingGallery(gallery);
		if (installed) {
			return installed;
		}
		const extension = this.instantiationService.createInstance(Extension, ext => this.getExtensionState(ext), undefined, undefined, gallery);
		if (maliciousExtensionSet.has(extension.identifier.id)) {
			extension.isMalicious = true;
		}
		return extension;
	}