-
Notifications
You must be signed in to change notification settings - Fork 298
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
Call hierarchy support #371
Comments
I apologise in advance for the shameless plug, but vim-ccls may be the kind of plugin you are looking for. It works on top of vim-lsp too! |
That looks pretty much like what I am taking about. I personally prefer clangd over ccls, I had a few issues with indexing with ccls. It may have changed since then. I notice that call hierarchy support is now part of the LSP spec, though not yet implemented by clangd. However I guess it should be possible to generate a reverse (the most useful) "reference" hierarchy tree incrementally by calling "get references" repeatedly. |
I think To implement a call hierarchy viewer here in vim-lsp, it would be possible to directly re-use the tree viewer I made. Not that it is hard to re-implement, but it can save some work. I made it as a general purpose library, independent and completely decoupled from the ccls-related part of the plugin. Here is the source, its documentation, and it comes with unit tests. And it is under MIT license, so it could be bundled in this project without any problem. |
Yes you're quite right re: references and callers. I have seen your tree implementation and agree vim-lsp should adopt it or something similar to show the call hierarchy. A shame clangd doesn't implement it yet, but I'm sure it's coming. |
@m-pilia Your general purpose tree seems awesome. I have been wanting to have a lightweight generic tree provider in vim for ages. I shared some thoughts here lambdalisue/vim-fern#3. Seems like we use different test framework and that could cause maintenance headache in the future. @m-pilia If you don't mind are you inteserted in sending PR for call hierarchy support in vim-lsp? |
@prabirshrestha Yes, I can work on a PR for this feature. So far I have not tested the official I second your idea of having a generic tree viewer plugin. I was actually considering to move the tree viewer out from vim-ccls to a separate plugin. The code is already decoupled, it is just a matter of moving the relevant files to a new repo. I was wondering if having an external dependency in vim-lsp for this would be ok for you. |
@yegappan once wrote a generic tree control for vim, but it was hosted on geocities and has since been lost. I've never seen the code and I don't know whatever happened to it: |
@m-pilia +1 for create a new repo that is just for treeview. That way we don't need to duplicate tests or worry about it. I actually think I did a mistake making allowing others depend on async.vim directly. This means I can never change the apis that would cause breaking changes even if it meant it was better. You may face the same problem with treeview plugin. I have always wanted to have a util method similar to Also would be good if one can just create a provider so we don't have to manually call render methods. |
@m-pilia I have filed an issue on your side to extract the tree so we can embed it in vim-lsp. m-pilia/vim-ccls#15 |
@prabirshrestha Thanks! I want to move this forward asap. Recently I have put quite some thoughts on this task and how to do it, but I have been silent for a while due to a crowded backlog. |
I made a new repo containig the library as it is now, and I am making ready to refactor it. The main issues are about the data API and the reliance on ftplugin. I think it should not be too much work for me to fix them, but I am a bit slow due to personal backlog. Luckily it should not be too urgent, since I am not aware of any major language server currently providing an implementation of the |
It will be good if we can easily copy paste the code and embed in in vim-lsp. One mistake I did with async.vim was make it like a lib which means I can never change the apis without breaking even if it is better. |
I will strive to make it possible to embed it. It would be nice if it were possible to have it as a git submodule/subtree, but I do not think there is any straightforward way to do it with git. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
this has had clangd support for a while, is there any chance on this being reopened and worked on again? |
Is there any chance of implementing a call hierarchy similar to lsp-mode for emacs? It uses the ccls call hierarchy command (plus a tree component of some kind) to generate a dependency tree like this:
Rather than rely on the non-standard hierarchy command, it would be great if vim-lsp could use the 'References' functionality to obtain references, then recursively obtain parent references as a user expands them within a tree. It would require a tree view of some kind, similar to nerdtree etc.
This may be outside the realm of vim-lsp - but it is a quite desirable feature that none of the LSP clients for vim currently implement (that I'm aware of).
The text was updated successfully, but these errors were encountered: