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

Comments are removed during transform. #198

Closed
NullVoxPopuli opened this issue Sep 6, 2019 · 2 comments
Closed

Comments are removed during transform. #198

NullVoxPopuli opened this issue Sep 6, 2019 · 2 comments

Comments

@NullVoxPopuli
Copy link
Contributor

Gonna submit a failing PR momentarily

@rwjblue
Copy link
Member

rwjblue commented Sep 6, 2019

In general, comments in the AST are "weird". They are effectively tacked on to the subsequent expression (e.g. not their own stand alone "thing" in the AST). In order to preserve comments you have to ensure that whenever you create a replacement AST node that you inherit the comments from the thing you are replacing.

There are a number of tests that do confirm that comments are not lost (e.g. module-for-acceptance.input.js and module-for-acceptance.output.js), but its completely possible that there are other scenarios that are loosing the comments.

In order to fix, you'll need to know specifically which scenarios are loosing comments.

@NullVoxPopuli
Copy link
Contributor Author

yup, here is the scenario: #199

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

No branches or pull requests

2 participants