From c266aa6b360a683f50b3370942fc7ebfcafc747a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sat, 30 Jan 2021 18:01:19 +0000 Subject: [PATCH] Flush pending changes to server before code actions request Otherwise the actions returned by the server might be stale when the user selects them. * eglot.el (eglot-code-actions): Issue jsonrpc-request with deferred=t. GitHub-reference: fix https://github.com/joaotavora/eglot/issues/609 --- lisp/progmodes/eglot.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 98e0bcf14fa..8403e5dfdb1 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2554,7 +2554,8 @@ at point. With prefix argument, prompt for ACTION-KIND." when (cdr (assoc 'eglot-lsp-diag (eglot--diag-data diag))) collect it)] - ,@(when action-kind `(:only [,action-kind])))))) + ,@(when action-kind `(:only [,action-kind])))) + :deferred t)) (menu-items (or (cl-loop for action across actions ;; Do filtering ourselves, in case the `:only' -- 2.39.2