From 64d7219a5dedbc7f6b55f82124a157045e5bff59 Mon Sep 17 00:00:00 2001 From: Rival Abdrakhmanov Date: Thu, 21 Nov 2024 09:37:47 +0100 Subject: [PATCH] Add background progress for downloading --- .../runner/localRun/FunctionRunExecutorFactory.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PluginsAndFeatures/azure-toolkit-for-rider/azure-intellij-plugin-appservice-dotnet/src/main/kotlin/com/microsoft/azure/toolkit/intellij/legacy/function/runner/localRun/FunctionRunExecutorFactory.kt b/PluginsAndFeatures/azure-toolkit-for-rider/azure-intellij-plugin-appservice-dotnet/src/main/kotlin/com/microsoft/azure/toolkit/intellij/legacy/function/runner/localRun/FunctionRunExecutorFactory.kt index d1723a7dfc..cdae970138 100644 --- a/PluginsAndFeatures/azure-toolkit-for-rider/azure-intellij-plugin-appservice-dotnet/src/main/kotlin/com/microsoft/azure/toolkit/intellij/legacy/function/runner/localRun/FunctionRunExecutorFactory.kt +++ b/PluginsAndFeatures/azure-toolkit-for-rider/azure-intellij-plugin-appservice-dotnet/src/main/kotlin/com/microsoft/azure/toolkit/intellij/legacy/function/runner/localRun/FunctionRunExecutorFactory.kt @@ -24,6 +24,7 @@ import com.intellij.openapi.diagnostic.debug import com.intellij.openapi.diagnostic.logger import com.intellij.openapi.diagnostic.trace import com.intellij.openapi.project.Project +import com.intellij.platform.ide.progress.withBackgroundProgress import com.jetbrains.rd.util.lifetime.Lifetime import com.jetbrains.rider.azure.model.AzureFunctionWorkerModel import com.jetbrains.rider.azure.model.AzureFunctionWorkerModelRequest @@ -75,9 +76,11 @@ class FunctionRunExecutorFactory( } val functionCoreToolsPath = withContext(Dispatchers.Default) { - FunctionCoreToolsManager - .getInstance() - .getFunctionCoreToolsPathOrDownloadForVersion(azureFunctionsRuntimeVersion) + withBackgroundProgress(project, "Getting Azure Functions core tools") { + FunctionCoreToolsManager + .getInstance() + .getFunctionCoreToolsPathOrDownloadForVersion(azureFunctionsRuntimeVersion) + } } if (functionCoreToolsPath == null) { LOG.warn("Unable to find or download Function core tools for the project '${parameters.projectFilePath}'")