-
-
Notifications
You must be signed in to change notification settings - Fork 14
[#215] Suggest existing poetry venvs that are in existing modules #217
[#215] Suggest existing poetry venvs that are in existing modules #217
Conversation
f8aca8b
to
bc3c2b3
Compare
bc3c2b3
to
b702342
Compare
@koxudaxi I must admit that I'm a little uncomfortable with how to test the plugin well. I did test manually in IJ Ultimate. There is some change in behavior here: module path is used instead of project path if it's non-null now. But, I was unable to get module to be non-null in IJ Ultimate when pulling up the dialog, not sure the scenario that would produce. |
@@ -55,20 +58,32 @@ class PyAddExistingPoetryEnvPanel(private val project: Project?, | |||
.panel | |||
add(formPanel, BorderLayout.NORTH) | |||
addInterpretersAsync(sdkComboBox) { | |||
detectPoetryEnvs(module, existingSdks, context, project?.basePath ?: newProjectPath) | |||
val existingSdkPaths = sdkHomes(existingSdks) | |||
val moduleSdks = allModules(project).parallelStream().flatMap { module -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.filterNot { it.isAssociatedWithAnotherModule(module) } | ||
val moduleSdkPaths = moduleSdks.map { it.name }.toSet() | ||
val sdks = rootSdks.filterNot { moduleSdkPaths.contains(it.name) } + moduleSdks | ||
sdks.sortedBy { it.name } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.filterNot { it.isAssociatedWithAnotherModule(module) } | ||
val moduleSdkPaths = moduleSdks.map { it.name }.toSet() | ||
val sdks = rootSdks.filterNot { moduleSdkPaths.contains(it.name) } + moduleSdks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is PyDetectedSdk -> | ||
setupPoetrySdkUnderProgress(project, module, existingSdks, newProjectPath, | ||
is PyDetectedSdk -> { | ||
val mappedModule = sdkToModule[sdk.name] ?: module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roxchkplusony
I guess the case is for PyCharm.
All changes look good. I will check the PR in PyCharm. |
|
@roxchkplusony Thank you very much. |
I'm so glad, thank you for your leadership! |
Fixes #215