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
Proposal: Custom extension fields #857
Conversation
Sync from upstream
…rmations for classes
Adding a filed is better than adding new option; Following commi is an example of adding a field. |
I read your patch. Currently customLabel holds a string. It should hold fieldType of field.h. |
A couple of things to consider:
|
I thnk the idea behind custom fields is good. Ideally I would like to extend it. We can replace extensionFields field in tagEntryInfo with:
Currently many things about extensionField is still handled in entry.c. With the replacement, many things can be done field.c. For attaching a field to a tag entry, you can use
You can use
Anyway, I would like to merge your latest result about C++ parser. I will write about the step for merging. |
Yep, having all "variable" extension fields is a nice idea. It probably requires some work in all the parsers though. The template information in the C++ parser is there since quite a lot of time, it's only waiting for a suitable method of writing it to output. So it can still wait a bit while we think about it. |
o.k. |
I'm working on this item now... I find a better API. It is nice if a parser can declare their own fields statically like
But I cannot implement all at once. I will provide small/simple one first as the initial shot. |
Yep, this way also would work. I'm OK with whatever lets me add custom fields to the output. |
After implementing I recognized that fields in an entry cannot be allocated dynamically; there is no chance to make it free. I have to use statically allocated array for awhile. |
…lue of field to a tag Based on the pull request universal-ctags#857 by @pragmaware.
No longer relevant since #872 has been merged. |
This is a proposal for adding custom extension fields.
It's not reasonable to add specific fields for all the possible extensions we might think of. Each parser will have its own subset instead. Each parser will be responsable of checking if the custom extension fields is enabled or not. Each parser will provide the label for the custom extension field (which is a static string anyway).
This pull also contains a sample usage of the custom extension fields: template information for classes.
Another commit in this pull enables the custom extension field with a parser specific option: --c++-enable-template-info. The advantage is that it is incredibly simple. No complicated code to add to handle parser specific parameters.
(Btw, the first two commits are an artefact of synchronizing with upstream: not sure how to get rid of them..maybe by deleting the fork and recreating it?)