Skip to content

consult-imenu: Support Emacs 31 nested entries#1307

Open
gessen wants to merge 1 commit intominad:mainfrom
gessen:imenu-emacs31
Open

consult-imenu: Support Emacs 31 nested entries#1307
gessen wants to merge 1 commit intominad:mainfrom
gessen:imenu-emacs31

Conversation

@gessen
Copy link
Copy Markdown

@gessen gessen commented Apr 11, 2026

With Emacs 31, Eglot, and the following C++ code:

struct foo {
  struct bar {
    struct faz {};
  };
};

Imenu correctly lists all nested symbols, allowing navigation to foo, bar, and faz. However, consult-imenu does not handle this properly and only exposes the innermost symbol (faz). This behavior appears to be language-agnostic and can be reproduced with other programming languages as well. Imenu supports nested symbols via the imenu-region text property, which Eglot may now provide.

In addition, Eglot may annotate its Imenu output with the imenu-kind property. consult-imenu could use this information to improve symbol categorization.

Emacs 31 adds support for navigating to outer Imenu nodes. However,
consult-imenu does not currently handle this correctly and only exposes
the innermost symbols. Imenu supports nested symbols navigation via the
`imenu-region` text property, which Eglot may now provide.

Additionally, Eglot may annotate Imenu entries with the imenu-kind
property. consult-imenu can use this information to improve symbol
categorization.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant