Proto not put comments in generated files
We have problem, when we define proto like this and generate C++ code:
// comment 1:
enum Type {
INVALID = 0;
UNSET = 1;
TYPE_ONE = 2;
}
/*
comment2
*/
message Test{
uint32 some1 = 1; // com1
uint32 some2 = 2; // com2
uint32 some3 = 3; // com3
}
Code works good in C++ and C# (we tested only this two languages), but in C++ we don't see any of this comments (like <summary> in C#). We try same proto in C#, and comments add normal. How we can get same functionality in C++. So how can we add comments in front of classes or enums? We use proto3 syntax with protobuf 3.6.1.
Thank you for help.
I think for C++ we have always done it this way and I'm not sure if there is any good reason for it. I am a bit hesitant to add in more comments, though, because I don't know what the effect on builds will be. Larger header files could result in slower compiles and less ability to cache results.
Reason why this will be good is to get comments (informations) on objects. Yes, this effects compile time, but helps users who reuse generated objects. They can get more info on what some objects do. Maybe a good solution is a flag, where you choose if you want add comments or not.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.
This issue is labeled inactive because the last activity was over 90 days ago.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.
This issue was closed and archived because there has been no new activity in the 14 days since the inactive label was added.