Skip to content

Commit 677a5ec

Browse files
committed
Per joaotavora/eglot#803: Change Rust language server to rust-analyzer
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): Add rust-mode language server "rust-analyzer" and prefer it to the older "rls". (eglot-rls, jsonrpc-connection-ready-p) (eglot-handle-notification): Delete special support for "rls". * eglot-tests.el (rls-analyzer-watches-files) (rls-analyzer-hover-after-edit): Rename to ... (rust-analyzer-watches-files) (rust-analyzer-hover-after-edit): ... this. Update tests to work with rust-analyzer. * README.md: Update references for RLS to point to rust-analyzer. * NEWS.md: Announce above change.
1 parent f8b8a45 commit 677a5ec

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

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" "rls"))
146146
(cmake-mode . ("cmake-language-server"))
147147
(vimrc-mode . ("vim-language-server" "--stdio"))
148148
(python-mode
@@ -2984,25 +2984,6 @@ If NOERROR, return predicate, else erroring function."
29842984
(when (eq ?! (aref arg 1)) (aset arg 1 ?^))
29852985
`(,self () (re-search-forward ,(concat "\\=" arg)) (,next)))
29862986

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

30072988
;;; eclipse-jdt-specific
30082989
;;;

0 commit comments

Comments
 (0)