From 7f062198c8677028c6ade0b68e07e5f26a3b4867 Mon Sep 17 00:00:00 2001 From: Michal Krzywkowski Date: Wed, 31 Oct 2018 14:16:56 +0100 Subject: [PATCH] Use the container name of a symbol in imenu * eglot.el (eglot-imenu): Prepend :containerName to each symbol, when provided. --- lisp/progmodes/eglot.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 26ee814755a..e15170400d8 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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) -- 2.39.2