-
Notifications
You must be signed in to change notification settings - Fork 29
Description
I initially wanted to make an issue titled Setting python-env.workspaceSearchPaths "globally" is ignored, but while looking to see if there was already an issue for this, I found the PR and that behavior looks intentional #863 (comment).
So there are really two parts to this issue: one for the current behavior, and a second for the extension to respect a "globally" (profile/user/application) set python-env.workspaceSearchPaths value.
Current behavior
- I think the documentation for the setting should declare that it is a workspace-level setting only. Setting it globally, only for it to be ignored without that being documented makes it look like there is a bug.
- It doesn't look like the setting interpolates vscode variables. If I set the value to
${workspaceFolder}/local/path, the venv manager does not find anything. However it does if I set the value tolocal/path.
Desired behavior
One of the long-running issues VS Code has had with managing Python environments in the past was that you could not specify a virtual environment path without modifying your workspace settings.json, which was annoying to deal with if you wanted to commit the settings.json to share other settings.
This resulted in teams either not sharing their .vscode/settings.json, or forcing everyone in the team to put their virtual environment in the same location for VS Code to correctly find the virtual environment.
When Python support was refactored out into it's own extension1, this was basically fixed. Searching for virtual environments wasn't perfect, but we no longer had to put our local virtual environment setup in the workspace settings.
Providing a python-env.workspaceSearchPaths setting that is only listened to when set for the workspace feels like a regression. IIRC, one idea that was thrown around in the issue discussion for the Python virtual environment setting was having a separate json file for local python settings, like the launch.json and extensions.json, but was dismissed because it did not match the design. It was ultimately a setting.
But if python-env.workspaceSearchPaths really is a setting that shouldn't be managed globally, then maybe this extension should consider managing workspace-level settings in a separate file, or maybe it should also listen to python.venvFolders/python.venvPath. Even though this setting is a list, creating a setting where everybody adds an entry for where they store local virtual environments is potentially cumbersome or becomes a setting that exists for one person and nobody else.
---
Sorry for the long description, or potentially repeating information you're already familiar with. I think the setting is drastic improvement over python.venvFolders/python.venvPath.
Footnotes
-
(Or maybe when a major refactor happened in the Python extension, I don't remember) ↩