Skip to content

Commit

Permalink
Unbreak imenu
Browse files Browse the repository at this point in the history
* eglot.el (eglot-imenu): Unbreak.
  • Loading branch information
joaotavora committed Oct 22, 2019
1 parent 243788d commit 6dd5de9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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."
Expand Down

0 comments on commit 6dd5de9

Please sign in to comment.