Skip to content
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

clang-tags database does not identify definitions #23

Open
nrnrnr opened this issue Dec 6, 2015 · 3 comments
Open

clang-tags database does not identify definitions #23

nrnrnr opened this issue Dec 6, 2015 · 3 comments

Comments

@nrnrnr
Copy link

nrnrnr commented Dec 6, 2015

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?

@ffevotte
Copy link
Owner

ffevotte commented Dec 6, 2015

I guess a good way to go would be to follow the same path as isDecl, which is very similar:

  1. in cursor.[hc]xx, add a new Cursor::isDefinition member function, whose definition can be inspired from Cursor::isDeclaration
  2. In storage.cxx, change the table structure to add the desired column, and modify the two addTag functions to accept another argument isDefn.
  3. in update.cxx, update the call to storage_.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...

@nrnrnr
Copy link
Author

nrnrnr commented Dec 6, 2015

I'll give it a try. Possibly this week, possibly next---it depends how writing goes.

@nrnrnr
Copy link
Author

nrnrnr commented Dec 8, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants