]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't block in eglot-imenu if performing non-essential task
authorJoão Távora <joaotavora@gmail.com>
Tue, 22 Dec 2020 17:35:08 +0000 (17:35 +0000)
committerJoão Távora <joaotavora@gmail.com>
Tue, 22 Dec 2020 17:35:08 +0000 (17:35 +0000)
eglot-imenu is used by imenu which in turn is used by which-func-mode
called from an idle timer.  We don't want it to block in that
situation.  Latest which-func mode now sets "non-essential" when
performing its duties, so we leverage that in eglot-imenu.

* eglot.el (eglot-imenu): Use non-essential.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/212

lisp/progmodes/eglot.el

index 1a53c16dfc905092ecbc1a5abc03e2bf82890ea7..c7f70ea141e8a3a3b9ae767322012f680d09603a 100644 (file)
@@ -2415,7 +2415,8 @@ is not active."
               (jsonrpc-request (eglot--current-server-or-lose)
                                :textDocument/documentSymbol
                                `(:textDocument
-                                 ,(eglot--TextDocumentIdentifier))))))))
+                                 ,(eglot--TextDocumentIdentifier))
+                               :cancel-on-input non-essential))))))
 
 (defun eglot--apply-text-edits (edits &optional version)
   "Apply EDITS for current buffer if at VERSION, or if it's nil."