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

Support recommended comments style #1172

Open
mantasindrasius opened this issue Feb 24, 2019 · 3 comments
Open

Support recommended comments style #1172

mantasindrasius opened this issue Feb 24, 2019 · 3 comments

Comments

@mantasindrasius
Copy link

protobuf.js version: 6.8.8

official protobuf Language Guide recommends using C/C++ style for comments, meaning either // or /* ... */.

Example:

/* SearchRequest represents a search query, with pagination options to
 * indicate which results to include in the response. */

message SearchRequest {
  required string query = 1;
  optional int32 page_number = 2;  // Which page number do we want?
  optional int32 result_per_page = 3;  // Number of results to return per page.
}

https://developers.google.com/protocol-buffers/docs/proto3 (see Adding Comments)

However, protobuf.js is now only support triple slash comments ///.

If I use the recommended style, the parsed AST is left with comment: null in case other styles are used.

This makes it very hard to use this great library for code or documentation generation for protos that the developer does not own.

@crdev
Copy link

crdev commented Feb 28, 2019

👍

@mkosieradzki
Copy link

mkosieradzki commented Dec 7, 2019

@dcodeIO Any comment on that? Your idea from #640 doesn't work well here (basically it is impossible to write comments that will work correctly with protobuf.js and protoc at the same time)... Maybe a switch between to modes would be a good approach?

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

4 participants