python-lsp / python-lsp-server

Fork of the python-language-server project, maintained by the Spyder IDE team and the community
MIT License
1.95k stars 194 forks source link

python-lsp-server vs Pyright language server. #90

Open hongyi-zhao opened 3 years ago

hongyi-zhao commented 3 years ago

What's the difference between python-lsp-server and pyright? See also the related issue here.

Regards, HZ

mkubasz commented 3 years ago

CPU usage. In my case, pls use fewer CPU resources then pyrigth.

krassowski commented 3 years ago

For one python-lsp-server is written in Python but pyright is written in TypeScript. Depending on how well you know each of the languages you may find it easier to contribute to one project or the other (but presumably it would be easier for target audience to contribute to python-lsp-server). pyright is a more recent server and has a strong emphasis on typing support (but you need to configure it to do so as the actual typing are only distributed in the closed-source pylance). Also pyright requires you to install node.js and npm, which is something that many users prefer to avoid. Finally before contributing to pyright you would need to sign a CLA with Microsoft, whereas python-lsp-server is more of an open source community supported project.

krassowski commented 3 years ago

pyright also supports some undocumented behaviour of LSP like sending null to close signature requests, as it well comes from the creators of LSP.

ccordoba12 commented 3 years ago

@krassowski, that sounds interesting. Could we implement sending null's here too?

krassowski commented 3 years ago

I think so. There are some other things to improve for signatures too, like recognising that signature overloading is now common in Python and sending these multiple signatures to the user instead of the first one only.

MicEsp22 commented 10 months ago

@krassowski "There are some other things to improve for signatures too, like recognising that signature overloading is now common in Python and sending these multiple signatures to the user instead of the first one only."

I came here for this exact point. Is it fixed or worked on? In Neovim, a weird behaviour persists as of today. When querying for signature help, only the first one is shown, even though the syntax itself suggests the use of an overloaded method (in the picture, it concerns the get() intrinsic dict class method.) immagine

On the other hand, when querying for signature hover (in insert mode, while typying the function parameters), both overloads are shown, but on the same line, which makes it hard to distinguish (this is probably caused by how the client (Neovim) handles the situation): immagine

But it is bizarre the fact that the server only provides the first match in one case, and both in the other.