FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix #26034: interpreter selection reverting to default interpreter by mohityadav8 · Pull Request #26063 · microsoft/vscode-python · GitHub

Fix #26034: interpreter selection reverting to default interpreter - #26063

Open
Mohit Yadav (mohityadav8) wants to merge 1 commit into
microsoft:mainfrom
mohityadav8:fix-26034-interpreter-selection
Open

Fix #26034: interpreter selection reverting to default interpreter#26063
Mohit Yadav (mohityadav8) wants to merge 1 commit into
microsoft:mainfrom
mohityadav8:fix-26034-interpreter-selection

Conversation

Mohit Yadav (mohityadav8) commented Jul 26, 2026
edited
Loading

Copy link
Copy Markdown

Fixes #26034

Root Cause

  1. Gate Mismatch (Single File Revert Bug): When a user has ms-python.vscode-python-envs installed but python.useEnvironmentsExtension is not explicitly set, shouldEnvExtHandleActivation() correctly yields control of the status bar to the Environments extension. However, setInterpreter.ts and resetInterpreter.ts were only checking useEnvExtension(), meaning they never reported interpreter selections to the Environments extension. The visible status bar therefore kept showing its default when working outside a workspace.
  2. Stale Cache Race Condition: getActiveInterpreter() races resolution against a 100ms timeout. On timeout, it falls back to a cached value. Previously, this cache wasn't cleared on config changes, so slow resolutions would surface old interpreters in the UI and get stuck there.

Changes

  • Widened gates in setInterpreter.ts, resetInterpreter.ts, and interpreterService.ts (resolveActiveInterpreter) to check useEnvExtension() || shouldEnvExtHandleActivation().
  • Added .catch() handling around legacy calls so synchronization failures don't undo the native setting.
  • Updated _onConfigChanged in interpreterService.ts to clear lastKnownActiveInterpreter and in-flight states when paths change.
  • Added timedOutActiveInterpreterKeys tracking to proactively trigger a display refresh once delayed resolutions finally complete.
  • Added shouldEnvExtHandleActivationStub to associated unit tests to support the widened logic gate.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot select interpreters

1 participant


Back | FazBrowse Home | New Git URL