Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import com.jetbrains.python.psi.PyElement
import com.jetbrains.python.psi.PyFile
import com.jetbrains.python.psi.PyFunction
import com.jetbrains.python.psi.resolve.QualifiedNameFinder
import com.jetbrains.python.sdk.pythonSdk
import mu.KotlinLogging
import org.jetbrains.kotlin.idea.base.util.module
import org.jetbrains.kotlin.idea.base.util.sdk
Expand Down Expand Up @@ -119,7 +120,7 @@ object PythonDialogProcessor {
}
}
}
val pythonPath = getPythonPath(elementsToShow)
val pythonPath = getPythonPath(project)
if (pythonPath == null) {
showErrorDialogLater(
project,
Expand Down Expand Up @@ -334,8 +335,8 @@ object PythonDialogProcessor {
}
}

fun getPythonPath(elementsToShow: Set<PyElement>): String? {
return findSrcModules(elementsToShow).first().sdk?.homePath
fun getPythonPath(project: Project): String? {
return project.pythonSdk?.homePath
}

fun findSrcModules(elements: Collection<PyElement>): List<Module> {
Expand Down