clang-tags
clang-tags copied to clipboard
clang-tags database does not identify definitions
I'm finding the clang-tags sqlite database incredibly useful for my project, but it would be even more useful if a new column were added to the tags table, containing the results of the libclang API call
CINDEX_LINKAGE unsigned clang_isCursorDefinition (CXCursor)
If there could be an isDefn
column along with the isDecl
column, that would be awesome.
I am willing to try to help make this happen with a fork and a pull request, but although I am a decent C programmer, my C++ skills are minimal. Can you give any guidance? What's a good way to proceed?
I guess a good way to go would be to follow the same path as isDecl
, which is very similar:
- in
cursor.[hc]xx
, add a newCursor::isDefinition
member function, whose definition can be inspired fromCursor::isDeclaration
- In
storage.cxx
, change the table structure to add the desired column, and modify the twoaddTag
functions to accept another argumentisDefn
. - in
update.cxx
, update the call tostorage_.addTag
to include the extra argument.
Please don't hesitate to tell me if you encounter difficulties ; I can also try to find some time to work on it...
I'll give it a try. Possibly this week, possibly next---it depends how writing goes.
I've tried your suggestion, and it works! Minor difficulty ensues if the new clang-tags server sees an old database.
I've submitted a pull request.