pyright-langserver
See original GitHub issueDescription
I’m trying to configure pyright as a Python language server, but haven’t had much success.
Reproduce
So far I have managed to get the jupyterlab-lsp installed (after struggling with some Internal Server 500 errors):
% jupyter labextension list
JupyterLab v3.0.7
Other labextensions (built into JupyterLab)
app dir: /home/jdsmith/.local/share/jupyter/lab
@krassowski/completion-theme v2.0.0 enabled OK
@krassowski/jupyterlab-lsp v3.4.1 enabled OK
Uninstalled core extensions:
@krassowski/jupyterlab-lsp
But I don’t get any additional completion/underlining/etc. features.
Expected behavior
I hoped to see underlines and signatures/etc. provided by pyright.
Context
- Language Server: pyright-langserver
- Language Server version: 1.1.113
- Language Server installed with:
npm
- Language Server Spec
I have also added the following file as pyright.json
to /etc/jupyter/jupyter_notebook_config.d
{
"pyright-langserver": { # the name of the implementation
"version": 1, # the version of the spec schema
"argv": ["pyright-langserver", "--stdio"], # a list of command line arguments
"languages": ["python"] # a list of languages it supports
}
}
I’m not certain if this is the right location to implement a new server spec. In fact I found the docs lacking there: lots of descriptions of what might go in such a spec file to configure a new LSP server, but no mention I could find of where to put it!
Before I dump a bunch of files on you, I want to see how I might learn whether juptyerlab_lsp
is in fact running, and if it has found (and rejected?) the langserver spec. I looked for [lsp]
output in a --debug
run of jupyter lab, but did not see any mentions.
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (10 by maintainers)
Top GitHub Comments
I found that setting
python.analysis.useLibraryCodeForTypes
totrue
works for popups.Open “Advanced Settings Editor” > “Language Server” and edit “User Preferences”.
Then restart Jupyter.
Note Starting with numpy 1.20 type stubs are included in numpy. Pyright uses type stubs for completion and popups.
useLibraryCodeForTypes: true
is effective for packages without type stubs (like pandas).Closing as pyright auto-detection was added in #587 and will be available in the next version 😃