Skip to content

Commit 615a339

Browse files
committed
Change Rust language server to rust-analyzer, drop rls
rust-analyzer is the officially blessed Language Server for Rust: rust-lang/rfcs#2912 Also drop the special support code for RLS. * eglot.el (eglot-server-programs): Change rust-mode language server from rls to rust-analyzer. (eglot-rls, jsonrpc-connection-ready-p) (eglot-handle-notification): Delete. * README.md: Update references for RLS to point to rust-analyzer.
1 parent b928aba commit 615a339

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ find-library` can help you tell if that happened.
6767
* R's [languageserver][r-languageserver]
6868
* Racket's [racket-langserver][racket-langserver]
6969
* Ruby's [solargraph][solargraph]
70-
* Rust's [rls][rls]
70+
* Rust's [rust-analyzer][rust-analyzer]
7171
* Scala's [metals][metals]
7272
* TeX/LaTeX's [Digestif][digestif]
7373
* VimScript's [vim-language-server][vim-language-server]
@@ -467,7 +467,7 @@ User-visible differences:
467467
connection name;
468468
- Pretty interactive mode-line section for live tracking of server
469469
communication;
470-
- Automatically restarts frequently crashing servers (like RLS);
470+
- Automatically restarts frequently crashing servers;
471471
- Slow-to-start servers start asynchronously in the background;
472472
- Server-initiated edits are confirmed with the user;
473473
- Diagnostics work out-of-the-box (no `flycheck.el` needed);
@@ -517,7 +517,7 @@ Under the hood:
517517
[r-languageserver]: https://cran.r-project.org/package=languageserver
518518
[racket-langserver]: https://github.com/jeapostrophe/racket-langserver
519519
[solargraph]: https://github.com/castwide/solargraph
520-
[rls]: https://github.com/rust-lang-nursery/rls
520+
[rust-analyzer]: https://github.com/rust-analyzer/rust-analyzer
521521
[metals]: https://scalameta.org/metals/
522522
[digestif]: https://github.com/astoff/digestif
523523
[vim-language-server]: https://github.com/iamcco/vim-language-server

eglot.el

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ chosen (interactively or automatically)."
142142
when probe return (cons probe args)
143143
finally (funcall err)))))))
144144

145-
(defvar eglot-server-programs `((rust-mode . (eglot-rls "rls"))
145+
(defvar eglot-server-programs `((rust-mode . ("rust-analyzer"))
146146
(cmake-mode . ("cmake-language-server"))
147147
(vimrc-mode . ("vim-language-server" "--stdio"))
148148
(python-mode
@@ -2983,25 +2983,6 @@ If NOERROR, return predicate, else erroring function."
29832983
(when (eq ?! (aref arg 1)) (aset arg 1 ?^))
29842984
`(,self () (re-search-forward ,(concat "\\=" arg)) (,next)))
29852985

2986-
2987-
;;; Rust-specific
2988-
;;;
2989-
(defclass eglot-rls (eglot-lsp-server) () :documentation "Rustlang's RLS.")
2990-
2991-
(cl-defmethod jsonrpc-connection-ready-p ((server eglot-rls) what)
2992-
"Except for :completion, RLS isn't ready until Indexing done."
2993-
(and (cl-call-next-method)
2994-
(or ;; RLS normally ready for this, even if building.
2995-
(eq :textDocument/completion what)
2996-
(pcase-let ((`(,_id ,what ,done ,_detail) (eglot--spinner server)))
2997-
(and (equal "Indexing" what) done)))))
2998-
2999-
(cl-defmethod eglot-handle-notification
3000-
((server eglot-rls) (_method (eql window/progress))
3001-
&key id done title message &allow-other-keys)
3002-
"Handle notification window/progress."
3003-
(setf (eglot--spinner server) (list id title done message)))
3004-
30052986

30062987
;;; eclipse-jdt-specific
30072988
;;;

0 commit comments

Comments
 (0)