palantir / python-language-server

An implementation of the Language Server Protocol for Python
MIT License
2.6k stars 283 forks source link

Support pyright #528

Open perfectspr opened 5 years ago

perfectspr commented 5 years ago

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.

dalisoft commented 4 years ago

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

TreeKat71 commented 3 years ago

Also want to know if it is in the roadmap.

lithammer commented 3 years ago

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
idr4n commented 3 years ago

@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"
lithammer commented 3 years ago

@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".

idr4n commented 3 years ago

@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!