Symbol navigation via ctrl-t does not work when the microsoft language server is enabled (jedi disabled)
See original GitHub issueEnvironment 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 (View
→Output
, 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:
- Created 5 years ago
- Comments:20 (8 by maintainers)
Top GitHub Comments
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.
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:
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.