From: João Távora Date: Sat, 30 Jan 2021 18:01:19 +0000 (+0000) Subject: Flush pending changes to server before code actions request X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~177 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c266aa6b360a683f50b3370942fc7ebfcafc747a;p=emacs.git 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 --- 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'