Skip to content

Commit

Permalink
Add pyright language server support for python-mode
Browse files Browse the repository at this point in the history
* eglot.el (eglot-server-programs): Add pyright support for
python-mode.
* README.md: Document the above change.

Copyright-paperwork-exempt: Yes
  • Loading branch information
Illia Danko authored and skangas committed Jan 8, 2022
1 parent b197e09 commit fd27cdc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ find-library` can help you tell if that happened.

* Javascript's [TS & JS Language Server ][typescript-language-server]
* Rust's [rls][rls]
* Python's [pylsp][pylsp] or [pyls][pyls]
* Python's [pylsp][pylsp], [pyls][pyls] or [pyright][pyright]
* Ruby's [solargraph][solargraph]
* Java's [Eclipse JDT Language Server][eclipse-jdt]
* Bash's [bash-language-server][bash-language-server]
Expand Down Expand Up @@ -547,6 +547,7 @@ Under the hood:
[rls]: https://github.com/rust-lang-nursery/rls
[pyls]: https://github.com/palantir/python-language-server
[pylsp]: https://github.com/python-lsp/python-lsp-server
[pyright]: https://github.com/microsoft/pyright
[gnuelpa]: https://elpa.gnu.org/packages/eglot.html
[melpa]: https://melpa.org/#/eglot
[typescript-language-server]: https://github.com/theia-ide/typescript-language-server
Expand Down
3 changes: 2 additions & 1 deletion eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ chosen (interactively or automatically)."

(defvar eglot-server-programs `((rust-mode . (eglot-rls "rls"))
(python-mode
. ,(eglot-alternatives '("pylsp" "pyls")))
. ,(eglot-alternatives
'("pylsp" "pyls" ("pyright-langserver" "--stdio"))))
((js-mode typescript-mode)
. ("typescript-language-server" "--stdio"))
(sh-mode . ("bash-language-server" "start"))
Expand Down

0 comments on commit fd27cdc

Please sign in to comment.