-
Notifications
You must be signed in to change notification settings - Fork 37
Closed
Copy link
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
The PET (Python Environment Tools) server now reports broken/invalid environments with an error field in the PythonEnvironment struct (e.g., detecting broken symlinks, missing Python executables). However, the VS Code extension doesn't receive or display this information to users.
Current Behavior
-
Missing
errorfield inNativeEnvInfointerface (nativePythonFinder.ts):export interface NativeEnvInfo { displayName?: string; name?: string; executable?: string; kind?: NativePythonEnvironmentKind; version?: string; prefix?: string; manager?: NativeEnvManagerInfo; project?: string; arch?: 'x64' | 'x86'; symlinks?: string[]; // Missing: error?: string; }
-
Broken environments silently skipped (venvUtils.ts):
for (const e of envs) { if (!(e.prefix && e.executable && e.version)) { log.warn(`Invalid venv environment: ${JSON.stringify(e)}`); continue; // Silently skips - users never see broken envs }
Impact
- Users cannot see or diagnose broken virtual environments
- Environments with broken symlinks (e.g., base Python was uninstalled) silently disappear from the list
- No actionable feedback to help users fix the issue
Expected Behavior
- Add
error?: stringfield toNativeEnvInfointerface - Display broken environments in the Environments view with a warning indicator
- Show the error message in tooltip/details so users understand what's wrong
- Allow users to remove/recreate broken environments
Proposed UI
- Show broken environments with a warning icon (
⚠️ ) or dimmed appearance - Tooltip should show: "This environment has issues: {error message}"
- Right-click menu could offer "Remove broken environment" option
Technical Changes Needed
- Add
errorfield toNativeEnvInfointerface - Update
findVirtualEnvironments()to include environments with errors - Update
PythonEnvironmentInfoAPI type if needed - Update environment tree view to handle error states
- Add appropriate UI styling for broken environments
Related
- PET already detects and reports these errors from
try_environment_from_venv_dir()inpet-venv/src/lib.rs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request