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

fix: invalid processing of leading and trailing comments #1593

Merged

Conversation

ykolbin
Copy link
Contributor

@ykolbin ykolbin commented Apr 20, 2021

There is an issue with preferred trailing comment processing (preferTrailingComment = true), if the next field contains a leading comment.

message A {
    // Field with both comments
    string field1 = 1; // trailing comment
 
    // Field with leading comment
    string field2 = 2;
}

Actual Result:
field1.comment = "Field with both comments"
field2.comment = "field2 trailing comment"

Expected Result:
field1.comment = "field1 trailing comment"
field2.comment = "field2 trailing comment"

@ykolbin
Copy link
Contributor Author

ykolbin commented Apr 20, 2021

Alexander Gennadievich (@alexander-fenster), could you help with review? 🙂

@alexander-fenster
Copy link
Contributor

Hi @ykolbin, nice to see you here :) Sure, we'll take care of this on our next review meeting within a week or so (it will require some staring in the code to figure out what's going on).

@alexander-fenster alexander-fenster merged commit 9011aac into protobufjs:master May 8, 2021
This was referenced Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants