Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-selected local environment not reflected in the status bar #16727

Closed
kimadeline opened this issue Jul 19, 2021 · 1 comment
Closed

Auto-selected local environment not reflected in the status bar #16727

kimadeline opened this issue Jul 19, 2021 · 1 comment
Assignees
Labels
area-environments Features relating to handling interpreter environments bug Issue identified by VS Code Team member as probable bug regression Bug didn't exist in a previous release

Comments

@kimadeline
Copy link

From #16723 (review):

When in the new sorting/auto-selection experiment (#16520):

  1. The first time updateDisplay is called the interpreter is python, so it will trigger auto-selection, so far so good;
  2. The new auto-selection logic will query interpreterService.getInterpreters, however this call will return cached interpreters, so the interpreter that will be displayed in the status bar is going to be one of my cached global interpreters;
  3. Then the auto-selection will be triggered again, this time by ExtensionActivationManager.activate, and this time the local virtual environment selected will be returned, but there is no updateDisplay call to reflect that change.

Proposed solution from @karrtikr: Add a way for getInterpreters to return fresh workspace envs and cached global envs (instead of just cached global envs)

@kimadeline kimadeline added bug Issue identified by VS Code Team member as probable bug needs PR regression Bug didn't exist in a previous release area-environments Features relating to handling interpreter environments labels Jul 19, 2021
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jul 19, 2021
@karrtikr
Copy link

The new auto-selection logic will query interpreterService.getInterpreters, however this call will return cached interpreters

Earlier, we had this to get fresh local envs. And got rest of the envs from cache.

We could either do that, or to keep things simple, we can get fresh envs (both local and global) in 2. by passing ignoreCache: true when calling interpreterService.getInterpreters here. It'll only be done once per workspace and once per session, and so should not be much expensive.

@kimadeline kimadeline self-assigned this Jul 20, 2021
@kimadeline kimadeline removed the triage-needed Needs assignment to the proper sub-team label Jul 20, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-environments Features relating to handling interpreter environments bug Issue identified by VS Code Team member as probable bug regression Bug didn't exist in a previous release
Projects
None yet
Development

No branches or pull requests

2 participants