Pryoritize reslove_python in venv selection#186
Pryoritize reslove_python in venv selection#186lucaSartore wants to merge 1 commit intomfussenegger:masterfrom
Conversation
|
Is there a scenario where the env variable is set but incorrect? I'd actually tend to update the documentation so that users don't have to re-implement that part if they customize it. |
|
I originally came across this issue because the venv-selector After looking into it more closely, I realized that venv-selector itself has a bug: it sets the environment variable incorrectly. I’ll be sending a PR to venv-selector to fix that, which means this PR here is no longer strictly necessary. That said, I still think the behavior described in the documentation—giving full control to resolve_python—is more desirable, since it ensures users can always override the defaults if they want. But I’ll leave the decision up to you. Once venv-selector is fixed, this PR becomes optional. EDIT: I created the PR in venv-selector, I link it here for trackability: linux-cultist/venv-selector.nvim#220 |
I think if it is more desirable depends on whether if there is a scenario where If there is, you're right, if there isn't, then the current logic means users might not have to re-implement the But leaving this open for more feedback. If anyone has a case where |
According to the documentation here:
nvim-dap-python should by default try to automatically find the virtual environment using environment variables, and specific folders, however a user of the plugin can override those settings with
resolve_python.However the code is not consistent with this description, and due to the ordering, environment variables override
resolve_pythonandresolve_pythonoverride the venv folders.I switched the order so that if the user defines
resolve_pythonhe has full control control on the environment, which I think is the desired behaveour.