-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Improve comment generation after compilation #15255
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
base: main
Are you sure you want to change the base?
Conversation
| const printNewLines = | ||
| isBlockComment && | ||
| skipNewLines !== COMMENT_SKIP_NEWLINE.ALL && | ||
| !this._noLineTerminator; | ||
| skipNewLines !== COMMENT_SKIP_NEWLINE.ALL && !this._noLineTerminator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the changes of tests come from here, from testing changes it looks ok,
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/53624/ |
|
I don't think this is a good approach, but it shouldn't be too bad.🤷 |
|
I believe this has new unintended behavior such as But that's nothing compared to improvement. |
| // | ||
| // | ||
|
|
||
| // |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could indicate a generator bug, since the input also contains this blank line, which was not printed correctly before, but that's not important.
fe3e5c0 to
f19ba6e
Compare
| if ( | ||
| lastNode.loc && | ||
| node.loc && | ||
| commentLoc && | ||
| commentLoc.start.line - lastNode.loc.end.line >= | ||
| node.loc.start.line - commentLoc.end.line | ||
| ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such a situation should not exist for @babel/parser, but I don't know what the parser plugin is, anyway, it doesn't matter if we add judgment.
Uh oh!
There was an error while loading. Please reload this page.