python-language-server icon indicating copy to clipboard operation
python-language-server copied to clipboard

[MS Language Server] Go to definition cannot traverse workspaces

Open DonJayamanne opened this issue 5 years ago • 5 comments

@amittleider commented on Fri Jun 07 2019

Currently the MS Language Server won't allow jumping to a class (using Go to Definition) if it's found in a different VSCode workspace.

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 #3977): LS

Expected behaviour

Go to definition jumps to the Level1Class object

Actual behaviour

Definition not found. Below is a gif.

go_to_definition_across_workspaces

Steps to reproduce:

  • Use this repo: https://github.com/amittleider/vscode_multi_workspace_bug_repro
  • Go to the file upper_level_class.py
  • Try to jump to the definition of the Level1Class object.
  • It will probably say "Cannot find definition"

DonJayamanne avatar Jun 10 '19 20:06 DonJayamanne

Since multi-root workspaces actually run multiple instances of the LS, one per root, it is not possible to navigate across since one LS does not know about another instance. Extension spawn instances as needed.

MikhailArkhipov avatar Jun 11 '19 17:06 MikhailArkhipov

@MikhailArkhipov Why can Jedi jump across workspaces?

I configure my workspaces like this because of my project structure. If I don't configure a workspace per project, the test discovery will fail.

amittleider avatar Jun 11 '19 17:06 amittleider

Probably because there is just a single instance for the entire code.

MikhailArkhipov avatar Jun 11 '19 18:06 MikhailArkhipov

Hi. Any news regarding this? This is a very important feature missing. To bad that I have to use jedi.

razvanpaul-mielcioiu avatar Jun 23 '20 09:06 razvanpaul-mielcioiu

This would require fundamental rework of the LS since it is designed to handle one workspace only. So it is unlikely to happen in the near term.

MikhailArkhipov avatar Jun 23 '20 15:06 MikhailArkhipov