mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
[python] lsp: fix windows executable
GitOrigin-RevId: 3c328701a698a8486f3d6d191eb68def7e4e5891
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c3650beaf7
commit
4a15c51165
@@ -20,12 +20,11 @@ val Editor.pythonSdk: Sdk?
|
||||
|
||||
fun Sdk.getExecutablePath(name: String): Path? = homePath?.let {
|
||||
val base = Path(it)
|
||||
if (OS.CURRENT == OS.Windows) {
|
||||
val candidates = listOf("exe", "bat", "cmd", "com").map { ext -> Path(it + "." + ext) }
|
||||
val found = candidates.firstNotNullOfOrNull { candidate -> PythonSdkUtil.getExecutablePath(candidate, name) }
|
||||
found ?: PythonSdkUtil.getExecutablePath(base, name)
|
||||
val candidates = if (OS.CURRENT == OS.Windows) {
|
||||
listOf("exe", "bat", "cmd", "com").map { ext -> "$name.$ext" }.plusElement(name)
|
||||
}
|
||||
else {
|
||||
PythonSdkUtil.getExecutablePath(base, name)
|
||||
listOf(name)
|
||||
}
|
||||
candidates.firstNotNullOfOrNull { candidate -> PythonSdkUtil.getExecutablePath(base, candidate) }
|
||||
}
|
||||
Reference in New Issue
Block a user