]> git.eshelyaron.com Git - emacs.git/commitdiff
Use the container name of a symbol in imenu
authorMichal Krzywkowski <k.michal@zoho.com>
Wed, 31 Oct 2018 13:16:56 +0000 (14:16 +0100)
committerMichal Krzywkowski <k.michal@zoho.com>
Sun, 4 Nov 2018 10:57:07 +0000 (11:57 +0100)
* eglot.el (eglot-imenu): Prepend :containerName to each symbol, when
  provided.

lisp/progmodes/eglot.el

index 26ee814755ad2648fb8f71c6a976169877268c1e..e15170400d8caf79e002a233e44b5613659f1aaf 100644 (file)
@@ -1657,10 +1657,15 @@ If SKIP-SIGNATURE, don't try to send textDocument/signatureHelp."
       (let ((entries
              (mapcar
               (jsonrpc-lambda
-                  (&key name kind location _containerName _deprecated)
+                  (&key name kind location containerName _deprecated)
                 (cons (propertize
-                       name :kind (alist-get kind eglot--symbol-kind-names
-                                             "(Unknown)"))
+                       (concat
+                        (and (stringp containerName)
+                             (not (string-empty-p containerName))
+                             (concat containerName "::"))
+                        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)