To investigate new files I'm used to run ctags
with the appropriate options, the problem is that apparently this program doesn't support C++11 and I was just using it fine until I discovered that the development of this program ended years ago .
Now I need an equivalent tool for C++11 and beyond, and I remember that clang
alone is able to output the AST
of any given file so I was wondering if the fronted had similar functionalities that were comparable to what I used to do with ctags
.
For example this are the entities that you can easily list with ctags
in C++ mode
ctags --list-kinds=c++
c classes
d macro definitions
e enumerators (values inside an enumeration)
f function definitions
g enumeration names
l local variables [off]
m class, struct, and union members
n namespaces
p function prototypes [off]
s structure names
t typedefs
u union names
v variable definitions
x external and forward variable declarations [off]
Does clang
is able to perform a similar task ?
Have a look at rtags tool. It uses clang to recompile your entire project. After that you can use it to navigate through the sources. The only problem is that AST is built after preprocessor has run, so the code that was disabled by macros is not available for navigation.
The projects maintains a set of elisp bindings that allows you to control
RTags
from emacs. For integration in vim see the third-party projects by lyuts or Shane Harper.