From 25825f5e6a40eacc2109026cb400df4cfdd8c0d9 Mon Sep 17 00:00:00 2001 From: Andrii Zinchenko Date: Tue, 8 Apr 2025 15:13:30 +0200 Subject: [PATCH] [eel] IJPL-172897: move `where` function to the EelExecApi GitOrigin-RevId: 349bd28772b8bf537ecc8421bccfeb00844ee1b6 --- .../intellij/platform/eel/provider/utils/eelProcessUtils.kt | 4 ---- platform/eel/src/com/intellij/platform/eel/EelExecApi.kt | 4 ++++ .../main/java/org/jetbrains/idea/maven/utils/MavenEelUtil.kt | 2 +- .../sh/core/src/com/intellij/sh/ShDocumentationProvider.kt | 2 +- .../junit5Tests/unit/alsoWin/ExecServiceShowCaseTest.kt | 2 +- .../src/com/intellij/python/hatch/HatchConfiguration.kt | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/platform/eel-provider/src/com/intellij/platform/eel/provider/utils/eelProcessUtils.kt b/platform/eel-provider/src/com/intellij/platform/eel/provider/utils/eelProcessUtils.kt index d21a429ea2d4..dcbec77f3245 100644 --- a/platform/eel-provider/src/com/intellij/platform/eel/provider/utils/eelProcessUtils.kt +++ b/platform/eel-provider/src/com/intellij/platform/eel/provider/utils/eelProcessUtils.kt @@ -62,10 +62,6 @@ suspend fun EelProcess.awaitProcessResult(): EelProcessExecutionResult { } } -suspend fun EelExecApi.where(exe: String): EelPath? { - return this.findExeFilesInPath(exe).firstOrNull() -} - /** * Given [this] is a binary, executes it with [args] and returns either [EelExecApi.ExecuteProcessError] (couldn't execute) or * [ProcessOutput] as a result of the execution. diff --git a/platform/eel/src/com/intellij/platform/eel/EelExecApi.kt b/platform/eel/src/com/intellij/platform/eel/EelExecApi.kt index 27d2a94c38a6..a8647cbb3efe 100644 --- a/platform/eel/src/com/intellij/platform/eel/EelExecApi.kt +++ b/platform/eel/src/com/intellij/platform/eel/EelExecApi.kt @@ -112,5 +112,9 @@ interface EelExecApi { data object RedirectStdErr : PtyOrStdErrSettings } +suspend fun EelExecApi.where(exe: String): EelPath? { + return this.findExeFilesInPath(exe).firstOrNull() +} + fun EelExecApi.execute(exe: String, vararg args: String): EelExecApiHelpers.Execute = execute(exe).args(*args) \ No newline at end of file diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenEelUtil.kt b/plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenEelUtil.kt index 7af927a254f5..af3ef318f7d5 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenEelUtil.kt +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenEelUtil.kt @@ -39,7 +39,7 @@ import com.intellij.platform.eel.provider.asNioPath import com.intellij.platform.eel.provider.asNioPathOrNull import com.intellij.platform.eel.provider.getEelDescriptor import com.intellij.platform.eel.provider.utils.fetchLoginShellEnvVariablesBlocking -import com.intellij.platform.eel.provider.utils.where +import com.intellij.platform.eel.where import com.intellij.platform.ide.progress.runWithModalProgressBlocking import com.intellij.platform.ide.progress.withBackgroundProgress import com.intellij.platform.util.progress.withProgressText diff --git a/plugins/sh/core/src/com/intellij/sh/ShDocumentationProvider.kt b/plugins/sh/core/src/com/intellij/sh/ShDocumentationProvider.kt index 5627b6e2e2d5..159d0f3fe273 100644 --- a/plugins/sh/core/src/com/intellij/sh/ShDocumentationProvider.kt +++ b/plugins/sh/core/src/com/intellij/sh/ShDocumentationProvider.kt @@ -16,7 +16,7 @@ import com.intellij.platform.eel.path.EelPath.Companion.parse import com.intellij.platform.eel.path.pathSeparator import com.intellij.platform.eel.provider.asNioPath import com.intellij.platform.eel.provider.getEelDescriptor -import com.intellij.platform.eel.provider.utils.where +import com.intellij.platform.eel.where import com.intellij.psi.PsiElement import com.intellij.psi.PsiFile import com.intellij.psi.impl.source.tree.LeafPsiElement diff --git a/python/python-exec-service/tests/com/intellij/python/junit5Tests/unit/alsoWin/ExecServiceShowCaseTest.kt b/python/python-exec-service/tests/com/intellij/python/junit5Tests/unit/alsoWin/ExecServiceShowCaseTest.kt index e22e163971ca..b525eca65de9 100644 --- a/python/python-exec-service/tests/com/intellij/python/junit5Tests/unit/alsoWin/ExecServiceShowCaseTest.kt +++ b/python/python-exec-service/tests/com/intellij/python/junit5Tests/unit/alsoWin/ExecServiceShowCaseTest.kt @@ -4,7 +4,7 @@ package com.intellij.python.junit5Tests.unit.alsoWin import com.intellij.platform.eel.EelPlatform import com.intellij.platform.eel.provider.asNioPath import com.intellij.platform.eel.provider.localEel -import com.intellij.platform.eel.provider.utils.where +import com.intellij.platform.eel.where import com.intellij.python.community.execService.ExecService import com.intellij.python.community.execService.WhatToExec import com.intellij.testFramework.common.timeoutRunBlocking diff --git a/python/python-hatch/src/com/intellij/python/hatch/HatchConfiguration.kt b/python/python-hatch/src/com/intellij/python/hatch/HatchConfiguration.kt index 0f88b6e8634e..96cb8d8b30f3 100644 --- a/python/python-hatch/src/com/intellij/python/hatch/HatchConfiguration.kt +++ b/python/python-hatch/src/com/intellij/python/hatch/HatchConfiguration.kt @@ -5,7 +5,7 @@ import com.intellij.platform.eel.EelApi import com.intellij.platform.eel.LocalEelApi import com.intellij.platform.eel.provider.asNioPath import com.intellij.platform.eel.provider.localEel -import com.intellij.platform.eel.provider.utils.where +import com.intellij.platform.eel.where import com.intellij.python.hatch.runtime.getHatchCommand import com.jetbrains.python.Result import java.nio.file.Path