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

[MS Language Server] Go to definition control only appears on primary workspace #5945

Closed
amittleider opened this issue Jun 7, 2019 · 2 comments

Comments

@amittleider
Copy link

Sometimes the Go to definition function will not appear in your VSCode if you have multiple workspaces and use the MS Language Server. You will only see the "Go to definition" function available if you are within the workspace that was active when you originally opened VSCode. Other workspaces will not have the Go to Definition function available.

Let me give an example to be clear:

  1. Example 1 - You can "Go to definition" in the upper_level_project workspace
  • Go to upper_level_class.py and reload VScode.
  • When VSCode comes back up, you should be able to right click and see that "Go to definition" is available.
  • Switch to the file level_2_class.py.
  • Right click on the class Level1Class and you will notice that there is no "Go to definition" button available to you.
  1. Example 2 - You can "Go to definition" in the level_2_project workspace.
  • Go to the file level_2_class.py and reload VSCode
  • When VSCode comes back up, you should be able to right click and see that "Go to definition" is available.
  • Switch to the file upper_level_class.py
  • Right click on the class Level2Class and you will notice that there is no "Go to definition" button available to you.

Below is a gif of the described behavior.
primary_workspace_bug

Environment data

  • VS Code version: 1.35.0
  • Extension version (available under the Extensions sidebar): 2019.5.18875
  • OS and version: Ubuntu 18.04
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.7 64 bit
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Language Server (more info How to update the language server to the latest stable version #3977): Language Server
@amittleider amittleider added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Jun 7, 2019
@DonJayamanne DonJayamanne self-assigned this Jun 10, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jun 10, 2019
@DonJayamanne DonJayamanne removed their assignment Jun 24, 2019
@MikhailArkhipov
Copy link

The issue is not a bug. LS only supports single root, it is not capable of handling multiple roots, especially with different versions of Python. Extension (and Visual Studio) runs multiple LS processes, one for each root (or project in solution in VS). Said instances are not able to communicate or navigate across tree spanning multiple processes. Making LS actually load multiple roots would a major architectural redesign. Thus the issue is that not that someone made a mistake (i.e. a bug) but rather conscious architectural design limitation.

@MikhailArkhipov MikhailArkhipov removed the bug Issue identified by VS Code Team member as probable bug label Sep 13, 2019
@luabud
Copy link
Member

luabud commented Mar 11, 2020

Closing in favour of #5132.

@luabud luabud closed this as completed Mar 11, 2020
@ghost ghost removed needs PR labels Mar 11, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Mar 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants