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

New workspace virtual environments are not discovered until VS Code reloads #656

Closed
qubitron opened this issue Jan 29, 2018 · 3 comments
Closed
Assignees
Labels
feature-request Request for new features or functionality

Comments

@qubitron
Copy link

Environment data

VS Code version: 1.19.3
Python Extension version: 2018.1 Beta
Python Version: Python 3.6
OS and version: Windows 10

Actual behavior

New virtual environments in your workspace root are not shown in the Select Interpreter list until restarting VS code

Expected behavior

New virtual environments within the workspace are shown upon running select interpreter

Steps to reproduce:

  • Created a new virtual environment from the terminal at the workspace root
  • Select interpreter from VS Code
@brettcannon
Copy link
Member

We are going to scope this to just virtual environments created in the workspace folder (should take into consideration the fact that pipenv can create its virtual environment locally when a certain environment variable is set).

@DonJayamanne DonJayamanne changed the title New virtual environments are not discovered until VS Code resets New workspace virtual environments are not discovered until VS Code reloads Sep 20, 2018
@DonJayamanne
Copy link

DonJayamanne commented Sep 20, 2018

Solution:

  • Add (vscode) file monitor for local workspace
  • If a file/folder is created, and check if we have an interpreter in there
    Use lookForInterpretersInDirectory
  • If there are no interpreters, then get out.
  • If we have an interpreter, then raise an event indicating the fact interpreters need to be refreshed
  • Add a handler for the above event in the CacheableLocatorService
  • In the event handler, clear the map promisesPerResource

@brettcannon
Copy link
Member

This doesn't seem to re-trigger if a virtual environment is deleted. Is that expected?

@lock lock bot locked as resolved and limited conversation to collaborators Dec 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

3 participants