From 03ac6a10acc4fa677f9dbff468a72ff4fbf06052 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felici=C3=A1n=20N=C3=A9meth?= Date: Sat, 4 Jan 2020 16:55:00 +0100 Subject: [PATCH] Send exit as a notification This is what the specification requires. @PerMildner, thanks for reporting and analyzing the issue. * eglot.el (eglot-shutdown): Use `notify' instead of `request' for the `exit' LSP method. GitHub-reference: fix https://github.com/joaotavora/eglot/issues/277 --- lisp/progmodes/eglot.el | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index e952b912d16..888eacc690a 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -596,11 +596,8 @@ SERVER. ." (progn (setf (eglot--shutdown-requested server) t) (jsonrpc-request server :shutdown nil :timeout (or timeout 1.5)) - ;; this one is supposed to always fail, because it asks the - ;; server to exit itself. Hence ignore-errors. - (ignore-errors (jsonrpc-request server :exit nil :timeout 1))) - ;; Now ask jsonrpc.el to shut down the server (which under normal - ;; conditions should return immediately). + (jsonrpc-notify server :exit nil)) + ;; Now ask jsonrpc.el to shut down the server. (jsonrpc-shutdown server (not preserve-buffers)) (unless preserve-buffers (kill-buffer (jsonrpc-events-buffer server))))) -- 2.39.2