tag: 1.2
commit 6788dbc492f33a5b2804f87b22bbe5794a497c9f
Author: Michał Krzywkowski <k.mic...@zoho.com>
Commit: Michał Krzywkowski <k.mic...@zoho.com>

    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.
---
 eglot.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/eglot.el b/eglot.el
index 2b39849..26ee814 100644
--- a/eglot.el
+++ b/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)

Reply via email to