From 66f5a1a8ee247ee3f314f5c12f539ea75aeeb66b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Tue, 22 Oct 2019 12:18:53 +0100 Subject: [PATCH] Unbreak imenu * eglot.el (eglot-imenu): Unbreak. --- lisp/progmodes/eglot.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index e29d8885774..9a0960d7a96 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2252,10 +2252,11 @@ If SKIP-SIGNATURE, don't try to send textDocument/signatureHelp." :deferred :textDocument/documentHighlight)))) eldoc-last-message) -(defun eglot-imenu (oldfun) - "EGLOT's `imenu-create-index-function' overriding OLDFUN." - (if (eglot--server-capable :documentSymbolProvider) - (let ((entries +(defun eglot-imenu () + "EGLOT's `imenu-create-index-function'." + (unless (eglot--server-capable :documentSymbolProvider) + (eglot--error "Server isn't a :documentSymbolProvider")) + (let ((entries (mapcar (eglot--lambda ((SymbolInformation) name kind location containerName) @@ -2283,7 +2284,7 @@ If SKIP-SIGNATURE, don't try to send textDocument/signatureHelp." elems))))) (seq-group-by (lambda (e) (get-text-property 0 :kind (car e))) entries))) - (funcall oldfun))) + ) (defun eglot--apply-text-edits (edits &optional version) "Apply EDITS for current buffer if at VERSION, or if it's nil." -- 2.39.2