From 7443bcf612c8df48004a9729f3a3514b985913bf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Tue, 22 Dec 2020 17:35:08 +0000 Subject: [PATCH] Don't block in eglot-imenu if performing non-essential task 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 1a53c16dfc9..c7f70ea141e 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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." -- 2.39.5