emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/eglot2emacs 3aeebe8186 037/120: Change rust language server to r


From: João Távora
Subject: feature/eglot2emacs 3aeebe8186 037/120: Change rust language server to rust-analyzer
Date: Thu, 20 Oct 2022 07:16:48 -0400 (EDT)

branch: feature/eglot2emacs
commit 3aeebe8186dfcc7e4a6df638bd44b4740895427f
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>

    Change rust language server to rust-analyzer
    
    rust-analyzer is the officially blessed Language Server for Rust:
    https://github.com/rust-lang/rfcs/pull/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.
    
    GitHub-reference: per https://github.com/joaotavora/eglot/issues/803
---
 lisp/progmodes/eglot.el | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 14a4d1cd43..fb2f1ba100 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -142,7 +142,7 @@ chosen (interactively or automatically)."
                       when probe return (cons probe args)
                       finally (funcall err)))))))
 
-(defvar eglot-server-programs `((rust-mode . (eglot-rls "rls"))
+(defvar eglot-server-programs `((rust-mode . ("rust-analyzer" "rls"))
                                 (cmake-mode . ("cmake-language-server"))
                                 (vimrc-mode . ("vim-language-server" 
"--stdio"))
                                 (python-mode
@@ -2985,25 +2985,6 @@ If NOERROR, return predicate, else erroring function."
   `(,self () (re-search-forward ,(concat "\\=" arg)) (,next)))
 
 
-;;; Rust-specific
-;;;
-(defclass eglot-rls (eglot-lsp-server) () :documentation "Rustlang's RLS.")
-
-(cl-defmethod jsonrpc-connection-ready-p ((server eglot-rls) what)
-  "Except for :completion, RLS isn't ready until Indexing done."
-  (and (cl-call-next-method)
-       (or ;; RLS normally ready for this, even if building.
-        (eq :textDocument/completion what)
-        (pcase-let ((`(,_id ,what ,done ,_detail) (eglot--spinner server)))
-          (and (equal "Indexing" what) done)))))
-
-(cl-defmethod eglot-handle-notification
-  ((server eglot-rls) (_method (eql window/progress))
-   &key id done title message &allow-other-keys)
-  "Handle notification window/progress."
-  (setf (eglot--spinner server) (list id title done message)))
-
-
 ;;; eclipse-jdt-specific
 ;;;
 (defclass eglot-eclipse-jdt (eglot-lsp-server) ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]