PY-88280 Replace switchToSdk with PySdkListener-based transferred roots handling

- Add PySdkTransferredRootsListener that handles root transfer and
  virtualenv exclusion reactively on PySdkListener.TOPIC
- Remove switchToSdk function from AddInterpreterActions
- Register listener in intellij.python.community.impl.xml
- Update PySdkPopupFactory, advancedActions, PySdkFromEnvironmentVariable
  to set module.pythonSdk directly

(cherry picked from commit 989a0d0d0be5722a92be8709868b97343e4889ae)

GitOrigin-RevId: b5d01f47409b127020a3021b1f3dc7ff8147ce9c
This commit is contained in:
Vitaly Legchilkin
2026-03-18 17:22:13 +00:00
committed by intellij-monorepo-bot
parent 17c8522684
commit af3a616572
6 changed files with 52 additions and 43 deletions
@@ -123,6 +123,11 @@
topic="com.intellij.openapi.fileEditor.FileEditorManagerListener"/>
</projectListeners>
<applicationListeners>
<listener class="com.jetbrains.python.sdk.PySdkTransferredRootsListener"
topic="com.jetbrains.python.sdk.PySdkListener"/>
</applicationListeners>
<extensions defaultExtensionNs="com.intellij">
<registryKey key="use.python.for.local.conda"
defaultValue="true"