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

Feature request: Workspace symbols/project wide symbols/navigate between symbols across files #46

Open
yingzhu146 opened this issue Apr 13, 2023 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@yingzhu146
Copy link

To say that I've been excited about a solution that would allow browsing symbols across files for a while, would be an understatement

simrat39/symbols-outline.nvim#159
nvim-neo-tree/neo-tree.nvim#593 (now being worked on nvim-neo-tree/neo-tree.nvim#841)

Now, I've absolutely fallen in love with navbuddy to explore new large repos - this has become my favorite neovim plugin.

It would feel highly natural to add an additional level of hierarchy that would allow jumping between files easily (e.g. if at top level of file, pressing h would show a list of files and you could easily switch between files.)

Alternatively, you could use the workspaceSymbols lsp call to get the whole workspace symbols (I think) and display the top level symbols across workspace files and thus allow switching between files by means of selecting from symbols across files.

In any event, if this is too complex or out of scope let me say this: out of all 153 installed plugins this is my favorite. thank you @SmiteshP ❤️

@SmiteshP
Copy link
Owner

Oh I see what you are saying, so it would be a fusion of ranger (outside file) + navbuddy (inside file). Very interesting idea, although this might be little difficult to implement, I can foresee some major refactoring might be needed to achieve this. Will have to think how this can be achieved 🤔 Some actions (like fold, comment) will not work in file space, and also will have to think how to preview file 🤔

In any event, if this is too complex or out of scope let me say this: out of all 153 installed plugins this is my favorite. thank you @SmiteshP ❤️

Thanks ❤️ Glad to know people find this useful

@SmiteshP SmiteshP added enhancement New feature or request help wanted Extra attention is needed labels Apr 15, 2023
@SmiteshP
Copy link
Owner

Looking at it, workspace symbols doesn't seem ideal for this. There is no "give me a list of all files in the project" kind of command in LSP protocol. Maybe implementing full file tree navigation is the way to go for this feature 🤔

@yingzhu146
Copy link
Author

yingzhu146 commented Apr 15, 2023

Yes exactly! Yeah I can see this might be a really big feature request, really appreciate you considering it! But I think would make exploring repos a real breeze!

This is a different request but goes into the same direction of adding extra navigation hierarchy layers:

https://github.com/chrisgrieser/nvim-spider

you could consider adding words & subwords as an additional, leaf node in the navigation tree.

That way navigating between tokens, subtokens, symbols & files would be handled perfectly analogous - I could imagine this replacing 80-90% of my normal mode usage!

Really makes much more sense than navigating character by character one you think about it!

Again, thanks a ton 🙏

@SmiteshP
Copy link
Owner

SmiteshP commented Apr 19, 2023

For this feature, What I am thinking about is rather than add a completely different functionality into the same plugin, I could write this as its own stand alone plugin for navigating file tree. And then both these plugins could figure out if the other is installed and have some level of integration with each other to achieve this thing. Let me know your thoughts on this.

you could consider adding words & subwords as an additional, leaf node in the navigation tree.

Not sure I understand this, how words and subwords navigation would work 🤔

@LittleTealeaf
Copy link

I too would totally love the ability to navigate files with this kind of UI. I've been slowly incorporating using the LSP selector to navigate between some larger files and it is a serious life-saver. Having some way to add on project/file traversal would just make this one of my most favorite plugins of all time :)

@yingzhu146
Copy link
Author

For this feature, What I am thinking about is rather than add a completely different functionality into the same plugin, I could write this as its own stand alone plugin for navigating file tree. And then both these plugins could figure out if the other is installed and have some level of integration with each other to achieve this thing. Let me know your thoughts on this.

Yeah that sounds like a great approach, sort of like plugin/extension - as long as it's seamlessly moving into each other that's perfect and very onboard with this!

you could consider adding words & subwords as an additional, leaf node in the navigation tree.

Not sure I understand this, how words and subwords navigation would work 🤔

From a display perspective I'm not too sure either 😅 since I assume you need to get a list and update the UI - from a movement perspective you could just hook into nvim-spider once that level is selected.

But let's table that for now - I can create a seperate issue once this becomes a huge itch :) just got carried away since I feel like this is just such a more natural way to navigate code than character wise.

I guess what you could do is just allow navigating via w/b etc while navbudy is selected (I'm stretching navbuddy to basically replace normal mode I realize, since it just so much more natural to me than normal mode movements)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants