From 3d91b57629d3f4ca307a561eb05a587e831d8554 Mon Sep 17 00:00:00 2001 From: Michal Krzywkowski Date: Wed, 31 Oct 2018 13:06:59 +0100 Subject: [PATCH] Don't ignore unknown symbolkinds in imenu Some servers provide custom SymbolKinds. For example, ccls says that symbols defined with #define are of kind 255. * eglot.el (eglot-imenu): Don't delete elements with unknown symbol kind from the return list, instead put them in `(Unknown)` group. --- lisp/progmodes/eglot.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 2b39849f9bc..26ee814755a 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1658,16 +1658,16 @@ If SKIP-SIGNATURE, don't try to send textDocument/signatureHelp." (mapcar (jsonrpc-lambda (&key name kind location _containerName _deprecated) - (cons (propertize name :kind (cdr (assoc kind eglot--symbol-kind-names))) + (cons (propertize + name :kind (alist-get kind eglot--symbol-kind-names + "(Unknown)")) (eglot--lsp-position-to-point (plist-get (plist-get location :range) :start)))) (jsonrpc-request (eglot--current-server-or-lose) :textDocument/documentSymbol `(:textDocument ,(eglot--TextDocumentIdentifier)))))) - (cl-remove nil - (seq-group-by (lambda (e) (get-text-property 0 :kind (car e))) - entries) - :key #'car)) + (seq-group-by (lambda (e) (get-text-property 0 :kind (car e))) + entries)) (funcall oldfun))) (defun eglot--apply-text-edits (edits &optional version) -- 2.39.2