emacs-diffs
[Top][All Lists]
Advanced

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

master 9848ae17161: Eglot: fix problems after changes to eglot-imenu (bu


From: João Távora
Subject: master 9848ae17161: Eglot: fix problems after changes to eglot-imenu (bug#62718)
Date: Fri, 7 Apr 2023 17:59:16 -0400 (EDT)

branch: master
commit 9848ae17161828190cc0ba31e89ae54a2f08a2ef
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Eglot: fix problems after changes to eglot-imenu (bug#62718)
    
    * lisp/progmodes/eglot.el (eglot--imenu-SymbolInformation)
    (eglot--imenu-DocumentSymbol): Fix.
---
 lisp/progmodes/eglot.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 99b3925f05f..6134ab9150c 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -3247,7 +3247,8 @@ for which LSP on-type-formatting should be requested."
          (let ((elems (mapcar
                        (eglot--lambda ((SymbolInformation) kind name location)
                          (let ((reg (eglot--range-region
-                                     (plist-get location :range))))
+                                     (plist-get location :range)))
+                               (kind (alist-get kind 
eglot--symbol-kind-names)))
                            (cons (propertize name
                                              'breadcrumb-region reg
                                              'breadcrumb-kind kind)
@@ -3262,13 +3263,14 @@ for which LSP on-type-formatting should be requested."
   "Compute `imenu--index-alist' for RES vector of DocumentSymbol."
   (cl-labels ((dfs (&key name children range kind &allow-other-keys)
                 (let* ((reg (eglot--range-region range))
+                       (kind (alist-get kind eglot--symbol-kind-names))
                        (name (propertize name
                                          'breadcrumb-region reg
                                          'breadcrumb-kind kind)))
-                  (if children
-                      (cons name
-                            (mapcar (lambda (c) (apply #'dfs c)) children))
-                    (cons name (car reg))))))
+                  (if (seq-empty-p children)
+                      (cons name (car reg))
+                    (cons name
+                            (mapcar (lambda (c) (apply #'dfs c)) children))))))
     (mapcar (lambda (s) (apply #'dfs s)) res)))
 
 (defun eglot-imenu ()



reply via email to

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