]> git.eshelyaron.com Git - emacs.git/commitdiff
Ignore errors when shutting down all LSP servers (bug#59146)
authorEvgeni Kolev <evgenysw@gmail.com>
Thu, 10 Nov 2022 17:17:44 +0000 (17:17 +0000)
committerJoão Távora <joaotavora@gmail.com>
Thu, 10 Nov 2022 17:18:13 +0000 (17:18 +0000)
eglot-shutdown-all has a bug that results in partially stopping
servers: when a server shutdown timeouts (1.5s), an error is
propagated and eglot-shutdown-all does not try to shutdown the rest of
the servers.

* eglot.el (eglot-shutdown-all): Ignore errors when shutting down
  servers, converting errors to messages.

lisp/progmodes/eglot.el

index f69d392b463363ac3624b8b4fef6ad3dace73edf..7fa4bd380ca5a7c64c536e84bfba76de886c8b62 100644 (file)
@@ -877,7 +877,8 @@ SERVER."
 PRESERVE-BUFFERS as in `eglot-shutdown', which see."
   (interactive (list current-prefix-arg))
   (cl-loop for ss being the hash-values of eglot--servers-by-project
-           do (cl-loop for s in ss do (eglot-shutdown s nil nil preserve-buffers))))
+           do (with-demoted-errors "[eglot] shutdown all: %s"
+                (cl-loop for s in ss do (eglot-shutdown s nil nil preserve-buffers)))))
 
 (defun eglot--on-shutdown (server)
   "Called by jsonrpc.el when SERVER is already dead."