hedyhli / outline.nvim

Code outline sidebar powered by LSP. Significantly enhanced & refactored fork of symbols-outline.nvim.
https://sr.ht/~hedy/outline.nvim
MIT License
543 stars 15 forks source link

[Feature Request] Call hierarchy support? #50

Closed ofseed closed 3 months ago

ofseed commented 6 months ago

LSP supports call hierarchy, but such call hierarchy can only support one level. It would be great if a tree-like one could be implemented in the form of outline.nvim.

There's a plugin that supports this, litee-calltree.nvim.

I think the final form it tries to implement is like outline.nvim.

hedyhli commented 3 months ago

Thanks for the suggestion. However I don't envision having support for symbols other than ones defined in the current file to have built-in in outline.nvim, since it is currently out of scope.

It could be possible, however, to implement this as an external provider plugin, which will fetch the symbols from the call hierarchy, then make use of outline's API and interface to display it as a tree.

adigitoleo commented 2 months ago

Not clear if it is already supported or if it requires this call hierarchy business, but what I would really like to have is a list of only those symbols that are declared/defined in the current buffer. Maybe this is the wrong place to ask but I've looked and couldn't find much on that kind of filtering specifically.

hedyhli commented 2 months ago

Symbols come from the provider for a buffer, which could be LSP or CoC. In most cases these symbols should already be ones defined in the current buffer. Your request is unrelated to this issue.

@adigitoleo would you mind opening a new issue for this and include a screenshot, the programming language for the buffer and the contents of :OutlineStatus when the buffer in question is focused?

adigitoleo commented 6 days ago

Thanks, @hedyhli, I figured out that my expectations were incorrect. In Python, when I import something, then it will of course show up in the LSP listing for the current buffer, despite being "declared" elsewhere. So I think there is no issue.