From 1e7981fd869742420f2a0add69aba0b5cc4aa0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Thu, 23 Oct 2025 21:42:00 +0100 Subject: [PATCH] Eglot: don't send JSONRPC params in 'shutdown' request (bug#79653) See also bug#66144. Github-reference: https://github.com/joaotavora/eglot/discussions/1540 * lisp/progmodes/eglot.el (eglot-shutdown): Pass :jsonrpc-omit (Package-Requires): Require jsonrpc 1.0.26. * etc/EGLOT-NEWS: Announce bugfix. --- etc/EGLOT-NEWS | 6 ++++++ lisp/progmodes/eglot.el | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/etc/EGLOT-NEWS b/etc/EGLOT-NEWS index 23104edd5d6..e420a84114d 100644 --- a/etc/EGLOT-NEWS +++ b/etc/EGLOT-NEWS @@ -60,6 +60,12 @@ Eglot now preserves crucial properties in the Markdown documentation provided by the LSP server, fixing a longstanding bug with clickable hyperlinks. See also github#1238. +** Compliant shutdown requests (bug#79653, bug#66144, github#1540) + +Eglot now complies with the latest LSP spec, which mandates that the +shutdown request mustn't have any parameters. This should fix problems +with some servers. + * Changes in Eglot 1.18 (20/1/2025) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 5277df8b7c4..e4d3ed122cc 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -7,7 +7,7 @@ ;; Maintainer: João Távora ;; URL: https://github.com/joaotavora/eglot ;; Keywords: convenience, languages -;; Package-Requires: ((emacs "26.3") (eldoc "1.14.0") (external-completion "0.1") (flymake "1.4.1") (jsonrpc "1.0.24") (project "0.9.8") (seq "2.23") (xref "1.6.2")) +;; Package-Requires: ((emacs "26.3") (eldoc "1.14.0") (external-completion "0.1") (flymake "1.4.1") (jsonrpc "1.0.26") (project "0.9.8") (seq "2.23") (xref "1.6.2")) ;; This is a GNU ELPA :core package. Avoid adding functionality ;; that is not available in the version of Emacs recorded above or any @@ -1270,7 +1270,7 @@ SERVER." (unwind-protect (progn (setf (eglot--shutdown-requested server) t) - (eglot--request server :shutdown eglot--{} :timeout (or timeout 1.5)) + (eglot--request server :shutdown :jsonrpc-omit :timeout (or timeout 1.5)) (jsonrpc-notify server :exit eglot--{})) ;; Now ask jsonrpc.el to shut down the server. (jsonrpc-shutdown server (not preserve-buffers))