Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 232 by sampo.niskanen: Standard way of commenting protobuf files

Request for enhancement:

A specific format should be defined for message/field comments in protobuf files (similar to for example Javadoc). Code generators could then include these comments as part of the comments of the generated code, allowing IDEs to display context help while coding.

For example a field might be commented by

 * The ISO 3166-1 alpha-2 country code of the user.
optional string country = 12;

This might be converted into Java as:

 * The ISO 3166-1 alpha-2 country code of the user.
 * @return the country field
public java.lang.String getCountry() { return country_; }

It should be considered what features would be desireable in such comments. For example a "@deprecated" notation could be useful in many situations. The code generators could of course implement these only to the extent that the target language supports them.

(An alternative would be to implement context-help directly into the IDE, but implementing it in the protobuf language would allow all existing IDEs to benefit from the comments automatically. At least Eclipse automatically detects the .java file and could provide context help if the file had Javadoc in it.)

You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to