From: Felicián Németh Date: Sat, 4 Jan 2020 15:55:00 +0000 (+0100) Subject: Send exit as a notification X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~258^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=03ac6a10acc4fa677f9dbff468a72ff4fbf06052;p=emacs.git 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 --- 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)))))