consult-imenu: Support Emacs 31 nested entries#1307
Open
gessen wants to merge 1 commit intominad:mainfrom
Open
consult-imenu: Support Emacs 31 nested entries#1307gessen wants to merge 1 commit intominad:mainfrom
gessen wants to merge 1 commit intominad:mainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With Emacs 31, Eglot, and the following C++ code:
Imenu correctly lists all nested symbols, allowing navigation to
foo,bar, andfaz. However,consult-imenudoes 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 theimenu-regiontext property, which Eglot may now provide.In addition, Eglot may annotate its Imenu output with the
imenu-kindproperty.consult-imenucould use this information to improve symbol categorization.