Search in sources :

Example 1 with VirtualEnvSdkFlavor

use of com.jetbrains.python.sdk.flavors.VirtualEnvSdkFlavor in project intellij-community by JetBrains.

the class PyConfigurableInterpreterList method addDetectedSdks.

private void addDetectedSdks(@NotNull final List<Sdk> result) {
    final List<String> sdkHomes = new ArrayList<>();
    sdkHomes.addAll(VirtualEnvSdkFlavor.INSTANCE.suggestHomePaths());
    for (PythonSdkFlavor flavor : PythonSdkFlavor.getApplicableFlavors()) {
        if (flavor instanceof VirtualEnvSdkFlavor)
            continue;
        sdkHomes.addAll(flavor.suggestHomePaths());
    }
    Collections.sort(sdkHomes);
    for (String sdkHome : SdkConfigurationUtil.filterExistingPaths(PythonSdkType.getInstance(), sdkHomes, getModel().getSdks())) {
        result.add(new PyDetectedSdk(sdkHome));
    }
}
Also used : PythonSdkFlavor(com.jetbrains.python.sdk.flavors.PythonSdkFlavor) ArrayList(java.util.ArrayList) PyDetectedSdk(com.jetbrains.python.sdk.PyDetectedSdk) VirtualEnvSdkFlavor(com.jetbrains.python.sdk.flavors.VirtualEnvSdkFlavor)

Aggregations

PyDetectedSdk (com.jetbrains.python.sdk.PyDetectedSdk)1 PythonSdkFlavor (com.jetbrains.python.sdk.flavors.PythonSdkFlavor)1 VirtualEnvSdkFlavor (com.jetbrains.python.sdk.flavors.VirtualEnvSdkFlavor)1 ArrayList (java.util.ArrayList)1