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

Support pyright

Open perfectspr opened this issue 5 years ago • 6 comments

Thank you for this awesome tool!

pyright is a static type checker for Python. It is typically 5x or more faster than mypy and other type checkers that are written in Python.

perfectspr avatar Mar 27 '19 02:03 perfectspr

Maybe faster, but i think author choose right tool as mypy will work fine. If you need better performance, then look at MS Python Server. I am currently looking in projects which doesn’t uses Microsoft products/apps, this project well made

dalisoft avatar May 30 '20 06:05 dalisoft

Also want to know if it is in the roadmap.

TreeKat71 avatar Jan 12 '21 08:01 TreeKat71

In case you didn't know, Pyright is also a language server nowadays (it powers microsoft/pylance). So you can just use it instead of python-language-server.

$ pyright-langserver --stdio

lithammer avatar Jan 12 '21 08:01 lithammer

@lithammer How would you install/configure pyright to use it with kak-lsp? pyright-langserver --stdio is in my path and added something like this to my kak-lsp.toml (but I'm just guessing here):

[language.python]
filetypes = ["python"]
roots = [".git"]
command = "pyright-langserver --stdio"

idr4n avatar Feb 10 '21 14:02 idr4n

@ivanddm no sorry, I don't use Kakoune. But by looking at the sample kak-lsp.toml in the repo I would guess something like this:

[language.python]
filetypes = ["python"]
roots = ["requirements.txt", "pyproject.toml", "setup.py", ".git"]
command = "pyright-langserver"
args = ["--stdio"]

It's unclear if you also need offset_encoding = "utf-8".

lithammer avatar Feb 10 '21 14:02 lithammer

@lithammer thanks for that... I tried what you suggest as well with and without offset_encoding = "utf-8" but still it is not picking up the server when opening python files... I'm going to raise this question in kak-lsp repo.

Thanks again!

idr4n avatar Feb 10 '21 14:02 idr4n