-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integration with imenu #19
Comments
Hi! I was playing around with this to try and see what kind of imenu integration I can get going, but I am getting a
It seems that the error is coming from within the Rust module? So I am not sure how I should go about to debug. For reference, this is what the function I'm testing looks like:
|
This line It probably means Also note that |
I see. Got it working again, thanks! Will start experimenting and move towards using |
I'm interested in implementing this. Do you have any tips for how to approach it? I was thinking maybe reusing the queries we use for highlighting (in |
Imenu support would be really great |
@DamienCassou See #199. It's still at the draft stage and I'm not sure what the best approach moving forward should be :/. |
I still haven't looked into #199 in details, but like @mohkale noted in that issue, I think arbitrary recursion is the single biggest challenge, specifically capturing the full paths of all nested items, not just the leaf identifiers. Queries alone are probably not expressive enough, so some sort of principled extension would be needed. On that front, I think it's worth exploring the newly introduced stack graphs, and the related graph DSL: (function_definition
name: (identifier) @name) @function
{
node @function.def
attr (@function.def) kind = "definition"
attr (@function.def) symbol = @name
edge @function.containing_scope -> @function.def
} I went through associated StrangeLoop talk. @dcreager illustrated the concepts very well. |
Hi! Is there any update on this feature? Thanks :) |
A simplistic
imenu-create-index-function
can look like this:A more substantial implementation can use
ts-query-matches
to capture nested structures.The text was updated successfully, but these errors were encountered: