vim-clang
vim-clang copied to clipboard
Can add "go to definition" and "go to declaration " ?
It is code completion is very good.But I think if not add "go to definition" and "go to declaration" function in vim-clang.If it has, I think it is better!
@yuquan23459 That's a problem I want to solve~ But that's not a easy problem, as clang driver does not provide these options, so we need to write our own driver based on libclang to do these things.
I have used youcompleteme and clang_complete,but they are not good.Clang_complete only can "goto declaration",and youcompleteme must include .cpp file so that can "goto definition",else if only can "goto declaration". In the way to "goto definition", sublimeclang is the best of all use clang plugin.But sublimeclang is sublime text 2 plugin.I think you can reference it.
@yuquan23459 yeah, I will try it. Now I am studying the clang index interface, but I am not sure when would the first version of clangd come out…Generally, I am familiar with the project source code, so I almost will not see the definition or somewhat. But this is really very nice for reading source code of some unfamiliar project-_-b
sublimeclang use libclang. It's no easy to use libclang...
Check funtion clang_getExpansionLocation:
http://clang.llvm.org/doxygen/group__CINDEX__LOCATIONS.html#gadee4bea0fa34550663e869f48550eb1f
These plugin will probably be a good reference for this isssue :smiley: https://github.com/libclang-vim/libclang-vim https://github.com/osyo-manga/vim-snowdrop
If you see Readme, this plugin doesn't use libclang on purpose. Ctags works more or less, it gets messy for cpp overloaded craps, but a good lightweight solution. Indeed, it'd be a nice feature, but even Clion doesn't sometimes get this right. Not entirely related, but for finding usages, you need cscope as well, so mixing plugins are inevitable in many cases.
So I suggest closing this issue, also considering the age of it. Just add it in readme that jumping to definition/declaration won't be supported.