src/vs/workbench/services/extensionManagement/electron-sandbox/remoteExtensionManagementService.ts/NativeRemoteExtensionManagementService/doInstallFromGallery
class NativeRemoteExtensionManagementService:	private async doInstallFromGallery(extension: IGalleryExtension, installOptions?: InstallOptions): Promise<ILocalExtension> {
		if (this.configurationService.getValue<boolean>('remote.downloadExtensionsLocally')) {
			this.logService.trace(`Download '${extension.identifier.id}' extension locally and install`);
			return this.downloadCompatibleAndInstall(extension);
		}
		try {
			const local = await super.installFromGallery(extension, installOptions);
			return local;
		} catch (error) {
			try {
				this.logService.error(`Error while installing '${extension.identifier.id}' extension in the remote server.`, toErrorMessage(error));
				this.logService.info(`Trying to download '${extension.identifier.id}' extension locally and install`);
				const local = await this.downloadCompatibleAndInstall(extension);
				this.logService.info(`Successfully installed '${extension.identifier.id}' extension`);
				return local;
			} catch (e) {
				this.logService.error(e);
				throw error;
			}
		}
	}