Skip to content

Restart language server if interpreter path of selected environment changes #18995

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

Closed
karrtikr opened this issue Apr 25, 2022 · 2 comments · Fixed by #19080
Closed

Restart language server if interpreter path of selected environment changes #18995

karrtikr opened this issue Apr 25, 2022 · 2 comments · Fixed by #19080
Assignees
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@karrtikr
Copy link

karrtikr commented Apr 25, 2022

Now that we support conda environments without python, installing python into those environments should result in restart of language servers as the python that is being used by the env changes. We can use

this.interpreterService.onDidChangeInterpreterInformation(
to check if interpreter path changes, or fire an event after
private async ensureEnvironmentContainsPython(pythonPath: string) {
finishes execution.

Related: #18964

@karrtikr karrtikr added bug Issue identified by VS Code Team member as probable bug area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. triage-needed Needs assignment to the proper sub-team labels Apr 25, 2022
@karrtikr karrtikr changed the title Restart language server if path to selected interpreter changes Restart language server if interpreter path of selected environment changes Apr 25, 2022
@karthiknadig karthiknadig added triage and removed triage-needed Needs assignment to the proper sub-team labels Apr 26, 2022
@karrtikr karrtikr added needs PR and removed triage labels May 2, 2022
@karrtikr karrtikr added this to the May 2022 milestone May 6, 2022
@TylerLeonhardt TylerLeonhardt added the verification-steps-needed Steps to verify are needed for verification label Jun 2, 2022
@TylerLeonhardt
Copy link
Member

What would be some good verification steps for this?

@kimadeline
Copy link

Let me know if the following works:

Pre-reqs:

  • Have Conda installed

Steps:

  1. Create a conda environment using the -n argument (will create a named conda environment without Python): conda create -n test1
  2. Open a folder with a Python file, activate the extension
  3. Make sure you have a language server running (look for Starting Pylance language server or Starting Jedi language server in the Python output channel)
  4. Open the interpreter selection quickpick and select the test1 environment, you may need to refresh the list of environments using the refresh button in the quickpick
  5. Make sure that the following message appears in the status bar:
    image
  6. There should be an interpreter refresh in the status bar once installation has finished, and once the refresh is done check that the Python output channel has multiple Starting [Pylance|Jedi] language server messages

@joyceerhl joyceerhl added verified Verification succeeded and removed verification-steps-needed Steps to verify are needed for verification labels Jun 3, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants