Skip to content
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

Option for navigating/understanding the call hierarchy? #23

Open
vinoff opened this issue Feb 21, 2025 · 7 comments
Open

Option for navigating/understanding the call hierarchy? #23

vinoff opened this issue Feb 21, 2025 · 7 comments
Assignees
Labels
enhancement New feature or request High-P Important but not an emergency. Work on it soon.

Comments

@vinoff
Copy link

vinoff commented Feb 21, 2025

There is this telescope plugin: https://github.com/jmacadie/telescope-hierarchy.nvim that is used for navigating the call hierarchy.

I don't use telescope though, I use snacks. Sadly, that is not available in Snacks. It would be nice if Namu provided that option, no? It seems like it is the sort of thing that Namu could do? However, I think that would require a previewer...

This is really good specially for navigating and understanding new codebases!

@bassamsdata bassamsdata added the enhancement New feature or request label Feb 21, 2025
@bassamsdata bassamsdata self-assigned this Feb 21, 2025
@bassamsdata
Copy link
Owner

Thanks for the suggestion!

I’ve never used call hierarchy, but it sounds like a great idea to implement. I’m curious to know how you envision it working.
Should it be part of the symbols picker, like the with a keymap feature that opens another window with the symbol’s hierarchy? Or could it be a separate command that can be invoked on any symbol in the buffer to open the call hierarchy?

I’d love to hear your thoughts and if you have any screenshots to illustrate your idea, please share them!

@vinoff
Copy link
Author

vinoff commented Feb 22, 2025

I don't have any screenshots. The plugin I shared has one screenshot, which you can use for inspiration.

I think it would be better if it was a different window, yes.

Additional suggestion: It would be nice to have those indentation lines (see the screenshot of the plugin I linked) to namu though, don't you think?

@bassamsdata bassamsdata added the Medium-P Needs to be done, but not urgent. label Feb 27, 2025
@bassamsdata
Copy link
Owner

@vinoff Hey,

I’ve almost finished working on the hierarchy module, and I have a few questions. I don’t typically use this kind of feature, but I ended up really liking it as I built it!

For sorting, I’m thinking of arranging items from the least nested to the most nested for better visual clarity—does that seem like a good approach?

I also added keymaps to navigate to the next and previous outgoing/incoming items, as well as to jump to the first child or root. Is there anything else you usually find useful?

Image

@vinoff
Copy link
Author

vinoff commented Mar 3, 2025

Honestly, I have also never used such a tool! I came across the one I linked for the first time, but didn't even use it haha.. I just know that it is one of those things that should be tremendously helpful to understand new codebases. It is almost like a mind-map of the code!

For sorting, I’m thinking of arranging items from the least nested to the most nested for better visual clarity—does that seem like a good approach?

Not sure. As always, it would be nice if this were configurable. The other option should be to maintain the order of the code, no? In fact, I think maintaining order is a better default, don't you agree? As it represents the code better...

The screenshot looks awesome @bassamsdata !!!

@bassamsdata bassamsdata added High-P Important but not an emergency. Work on it soon. and removed Medium-P Needs to be done, but not urgent. labels Mar 3, 2025
@vinoff
Copy link
Author

vinoff commented Mar 9, 2025

Any news on this @bassamsdata? I am really looking forward to this feature! I keep checking this everyday haha.

@bassamsdata
Copy link
Owner

Hey @vinoff, thanks for checking in! It’s been almost ready for a couple of days now, just putting the final touches on the configuration. I got a bit busy, but I’m hoping to have it out today or tomorrow at the latest!

@vinoff
Copy link
Author

vinoff commented Mar 12, 2025

Nice! I am really looking forward to it! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request High-P Important but not an emergency. Work on it soon.
Projects
None yet
Development

No branches or pull requests

2 participants