-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Triple Slash comments produce comment offset in generated files. #762
Comments
It's probably fair to note that we will probably switch to having /** */ comments on the messages at some point anyway, but for now we have the simple /// line. Cheers |
The parser looks at trailing comments only for non-block structures (anything that doesn't use You can see this here: https://github.com/dcodeIO/protobuf.js/blob/master/src/parse.js#L297 In your example, this leads to misinterpretation where comments belong, which certainly needs some improvements in detecting compatible comment types. However, your first comment ( |
We will change to the block comments which is what we should have used for the message anyway. I thought it might be related, but it only looked related. Cheers |
… comments for the next declaration, see #762
This adds a little more knowledge about trailing comments to the parser. It should accept:
plus, it prefers comments on top over trailing comments:
and, of course, it shouldn't confuse trailing comments anymore. |
protobuf.js version: 6.7.3
This is similar to an issue I had reported concerning, I think, a blank line before an enum offset the comments.
It would seem that a triple slash comment on the message definition line also causes subsequent triple slash comments to offset as well.
produces the following
The text was updated successfully, but these errors were encountered: