diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9e7876a..1d0a99d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,7 @@ intelliJPlatform = "2.0.1" jupiter = "5.10.3" kotlin = "2.0.10" kover = "0.9.2" -ktlint = "12.1.1" +ktlint = "13.1.0" remoteRobot = "0.11.23" taskinfo = "2.2.0" testLogger = "4.0.0" diff --git a/src/main/kotlin/com/github/pyvenvmanage/actions/ConfigurePythonActionAbstract.kt b/src/main/kotlin/com/github/pyvenvmanage/actions/ConfigurePythonActionAbstract.kt index f7d98f6..52cc75d 100644 --- a/src/main/kotlin/com/github/pyvenvmanage/actions/ConfigurePythonActionAbstract.kt +++ b/src/main/kotlin/com/github/pyvenvmanage/actions/ConfigurePythonActionAbstract.kt @@ -27,18 +27,23 @@ abstract class ConfigurePythonActionAbstract : AnAction() { // - any files within the binary folder. e.presentation.isEnabledAndVisible = when (val selectedPath = e.getData(CommonDataKeys.VIRTUAL_FILE)) { - null -> false - else -> + null -> { + false + } + + else -> { when (selectedPath.isDirectory) { true -> { // check if there is a python executable available under this folder -> name match for binary PythonSdkUtil.getPythonExecutable(selectedPath.path) != null } + false -> { // check for presence of the activate_this.py + activate alongside or pyvenv.cfg above PythonSdkUtil.isVirtualEnv(selectedPath.path) } } + } } }