You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @mamaniv, thanks for reporting this. The formatting of comments intentionally puts trailing comments on top due to a personal preference. However, I can see how this is confusing and the default behavior could indeed be to follow the current placement of comments as closely as possible.
I'm trying to parse and generate code using acorn and astring and I get the following issue:
I parse this code using acorn:
and then generate this code using astring:
as you can see, "comment after" should be after the line and not before the line.
a working sample app to easily reproduce the issue:
Versions:
Reviewing the code, looks like you write the comments before the statement, even though the location index may be after the statement:
I think you should also consider the locations (start/end) before writing the comments.
Thanks.
The text was updated successfully, but these errors were encountered: