Skip to content

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

Closed

Description

@qubitron

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

Activity

  1. brettcannon commented on Sep 20, 2018

    @brettcannon
    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).

  2. changed the title [-]New virtual environments are not discovered until VS Code resets[/-] [+]New workspace virtual environments are not discovered until VS Code reloads[/+] on Sep 20, 2018
  3. DonJayamanne commented on Sep 20, 2018

    @DonJayamanne

    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
  4. brettcannon commented on Nov 5, 2018

    @brettcannon
    Member

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

  5. locked as resolved and limited conversation to collaborators on Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestRequest for new features or functionality

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions