emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eglot 22e5c57 18/45: Don't ignore unknown SymbolKinds i


From: João Távora
Subject: [elpa] externals/eglot 22e5c57 18/45: Don't ignore unknown SymbolKinds in imenu
Date: Thu, 22 Nov 2018 19:15:29 -0500 (EST)

branch: externals/eglot
commit 22e5c579a2177f887a27029d83e0d8f78094f33a
Author: Michał Krzywkowski <address@hidden>
Commit: Michał Krzywkowski <address@hidden>

    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

[Prev in Thread] Current Thread [Next in Thread]