-
Notifications
You must be signed in to change notification settings - Fork 38
Description
Problem
During extension startup, two noisy error patterns appear in the output log:
1. workspaceSearchPaths error logged multiple times per session
The error python-envs.workspaceSearchPaths is set at the user/global level, but this setting can only be set at the workspace or workspace folder level is logged every time getWorkspaceSearchPaths() is called. Since configure() is called before every doRefresh() and resolve() operation during startup, the same error appears 6-8 times in a single activation.
This violates the project guideline: "Avoid showing the same error message multiple times in a session."
2. Unresolved ${workspaceFolder} passed to PET resolve
When python.defaultInterpreterPath is set to ${workspaceFolder}/.venv/bin/python3 and the priority chain runs in global scope (no workspace folder), resolveVariables() cannot resolve ${workspaceFolder}. The literal string ${workspaceFolder}/.venv/bin/python3 is then sent to PET's resolve RPC, which fails with:
Failed to execute Python to resolve info "${workspaceFolder}/.venv/bin/python3": No such file or directory (os error 2)
The extension does recover via auto-discovery fallback, but the PET error is unnecessary and alarming to users.
Expected Behavior
- The
workspaceSearchPathsglobal-level warning should be logged at most once per session - Paths with unresolved variables (
${...}) should be detected before calling PET resolve, with a clear warning and immediate fallback to auto-discovery
Reproduction
- Set
python-envs.workspaceSearchPathsat the user/global level in settings.json - Set
python.defaultInterpreterPathto${workspaceFolder}/.venv/bin/python3 - Open a workspace — observe repeated errors in the Python Environments output channel