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

Blank line between message comments and message caused an offset in the property/element comments #713

Closed
ehallander9591 opened this issue Mar 22, 2017 · 2 comments
Labels

Comments

@ehallander9591
Copy link

ehallander9591 commented Mar 22, 2017

protobuf.js version: <6.6.5>

I had gotten used to using the generated jsdocs for my protobuf objects, and then came across an generation error that I just couldn't see the forest through the trees for a long time. The comment on a particular attribute, which alphabetically was the first attribute in the object documentation, had the default comment, when I was pretty sure the source .proto file had a /// comment. Long story short, it turned out that the message /** ... */ comment had a blank line after it, and what that did was offset all the attribute comments by 1 as show in this simple example.

syntax = "proto3";

package issue;

/**
 * Message Comment
 */

message SomeMessage {
    string field1 = 1; /// This is Field 1
   string field2 = 2; /// This is Field 2

   string cField1 = 3; /// Should be the second field
   string alphabeticallyFirstField = 4; /// Comment for alphabeticallyFirstField 
}
        /**
         * SomeMessage field1.
         * @type {string}
         */
        SomeMessage.prototype.field1 = "";

        /**
         * This is Field 1
         * @type {string}
         */
        SomeMessage.prototype.field2 = "";

        /**
         * SomeMessage cField1.
         * @type {string}
         */
        SomeMessage.prototype.cField1 = "";

        /**
         * Should be the second field
         * @type {string}
         */
        SomeMessage.prototype.alphabeticallyFirstField = "";

<please paste the stack trace of the error if applicable>

Cheers

@dcodeIO
Copy link
Member

dcodeIO commented Mar 22, 2017

Should be fixed in master. Feel free to reopen if there are any remaining issues!

@dcodeIO dcodeIO closed this as completed Mar 22, 2017
@ehallander9591
Copy link
Author

Thank you kindly sir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants