mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
added search for venv in .virtualenvs
This commit is contained in:
@@ -3,7 +3,9 @@ package com.jetbrains.python.sdk;
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.openapi.actionSystem.PlatformDataKeys;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.SystemProperties;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -29,6 +31,13 @@ public class VirtualEnvSdkFlavor extends CPythonSdkFlavor {
|
||||
if (rootDir != null)
|
||||
candidates.addAll(findInDirectory(rootDir));
|
||||
}
|
||||
VirtualFile userHome = LocalFileSystem.getInstance().findFileByPath(SystemProperties.getUserHome().replace('\\','/'));
|
||||
if (userHome != null) {
|
||||
VirtualFile child = userHome.findChild(".virtualenvs");
|
||||
if (child != null) {
|
||||
candidates.addAll(findInDirectory(child));
|
||||
}
|
||||
}
|
||||
return candidates;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user