]> git.eshelyaron.com Git - emacs.git/commitdiff
C-u m-x eglot discards class guessed by eglot--guess-contact
authorJoão Távora <joaotavora@gmail.com>
Sun, 10 Jan 2021 16:42:59 +0000 (16:42 +0000)
committerJoão Távora <joaotavora@gmail.com>
Sun, 10 Jan 2021 16:46:59 +0000 (16:46 +0000)
This will prevent C-u M-x eglot RET rust-analyzer from bringing into
play the eglot-rls server class, which is only valid for the default
RLS server.

Found when testing for https://github.com/joaotavora/eglot/issues/526, though this bug might not necessarily be
the problem being reported there.

* eglot.el (eglot--guess-contact): Don't assume guessed class if
INTERACTIVE.

lisp/progmodes/eglot.el

index 9267a138bd367a7f59a21d3544eb030f8f8ba663..5bd087c4354b088335c0e5091050c8c308a57830 100644 (file)
@@ -725,7 +725,8 @@ be guessed."
          (guess (if (functionp guess)
                     (funcall guess interactive)
                   guess))
-         (class (or (and (consp guess) (symbolp (car guess))
+         (class (or (and (not interactive)
+                         (consp guess) (symbolp (car guess))
                          (prog1 (car guess) (setq guess (cdr guess))))
                     'eglot-lsp-server))
          (program (and (listp guess)