]> git.eshelyaron.com Git - emacs.git/commitdiff
Flush pending changes to server before code actions request
authorJoão Távora <joaotavora@gmail.com>
Sat, 30 Jan 2021 18:01:19 +0000 (18:01 +0000)
committerJoão Távora <joaotavora@gmail.com>
Sat, 30 Jan 2021 18:01:19 +0000 (18:01 +0000)
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

index 98e0bcf14fa869094146b45f5b9bb57647ff57fa..8403e5dfdb13ea3413c2e650536710635aad26e2 100644 (file)
@@ -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'