question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Symbol navigation via ctrl-t does not work when the microsoft language server is enabled (jedi disabled)

See original GitHub issue

Environment data

  • VS Code version: 1.27.2
  • Extension version (available under the Extensions sidebar): 2018.8.0
  • OS and version: Ubuntu 16.04
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6 or 3.7 built from source
  • Type of virtual environment used: virtualenv / python -m venv
  • Relevant/affected Python packages and their versions: N/A

Steps to reproduce:

Disable jedi in settings.json. Here the full settings.json I used to make sure that this issue is not caused by a problem in my config:

{
    "python.jediEnabled": false
}

Then try with the following mixed Python/Cython/C/C++ code base:

$ git clone https://github.com/scikit-learn/scikit-learn
$ cd scikit-learn
$ code .

Then hit “ctrl-t” and type “KMeans” for instance.

Actual behavior

The ctrl-t menu is never populated as expected (it stays empty). I have the same problem with other symbols defined in this project (e.g. LogisticRegression, check_array…).

The “Analysing workspace, 1 item remaining…” message never goes away.

Weirdly enough, hitting “F12” on a Python symbol defined in the workspace can make VS code navigate to it successfully. It’s just the ctrl-t symbol search menu that’s broken.

Expected behavior

Being able to open the k_means_.py file from the project folder in the workspace to navigate to the definition of the KMeans class.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Starting Microsoft Python language server.
Initializing for /volatile/ogrisel/.virtualenvs/py36/bin/python
##########Linting Output - pylint##########
[snip]

[Error - 09:52:35] Request workspace/symbol failed.
  Message: Object reference not set to an instance of an object.
  Code: -32000 
[object Object]
[Error - 09:52:36] Request workspace/symbol failed.
  Message: Object reference not set to an instance of an object.
  Code: -32000 
[object Object]
...

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

[nothing]

Also note that jedi has no problem with this workspace.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ogriselcommented, Jan 23, 2019

I confirm that the Go To Symbol feature works on scikit-learn when using the beta channel. Thank you very much.

Looking forward to the resolution for the CPU usage issue now 😃 The trace output shows that the language server never seems to get back analysis results for the majority of the files of the project: only the first queued file (in my cases setup.py) ever receives an analysis back from the language server. All the other queued files seem to be stalled and CPU usage stays at 100% forever without any output in the trace-level log.

Feel free to close this issue if you wish, as the symbol navigation part is fixed.

1reaction
jakebaileycommented, Jan 17, 2019

It’s currently in our daily and beta channels, not the stable release (since it’s brand new). You can switch to one of those to test a non-stable build by setting one of the following in your settings:

"python.analysis.downloadChannel": "daily"
"python.analysis.downloadChannel": "beta"

If you want to go back to stable, you can remove that line and delete the folders with names starting with languageServer inside of the extension’s directory, as the extension will not rollback to an older version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Language Server Extension Guide - Visual Studio Code
Learn how to create Language Servers to provide rich language features in Visual Studio Code.
Read more >
Language Server Protocol integration for Jupyter[Lab]
The following language servers are tested against jupyterlab-lsp and any issues when using them in notebooks will be prioritised.
Read more >
Neovim for Beginners — LSP (Part 1) | by alpha2phi | Medium
Run the :PackerInstall command to install the plugins now. The language servers are installed automatically. Auto Installation of Language Servers. Omni ...
Read more >
python-lsp-server - PyPI
Installation. The base language server requires Jedi to provide Completions, Definitions, Hover, References, Signature Help, and Symbols: pip install python- ...
Read more >
VSCode Python Extension "Downloading Microsoft Python ...
You can switch to Jedi via the settings: "python.jediEnabled": true, "python.languageServer": "Jedi",. If that doesn't work then please file ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found