Skip to content

Comments removed after transforming the AST #43794

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

Closed
lrabinowicz opened this issue Apr 23, 2021 · 4 comments
Closed

Comments removed after transforming the AST #43794

lrabinowicz opened this issue Apr 23, 2021 · 4 comments
Labels
Duplicate An existing issue was already created

Comments

@lrabinowicz
Copy link

lrabinowicz commented Apr 23, 2021

Bug Report

Comments before "}" (close bracket) are removed after transforming the AST for the file. Structure: Block.
image

Comments after "{" (open bracket) are removed if they are in the same line as the bracket after transforming the AST for the file. Structure: Block
image

Comments after a "," are removed after transforming the AST for the file.
image
image

In this PR there are some fixes but the ones mentioned above still happen:
#17689

🙁 Actual behavior

Comments are removed.

🙂 Expected behavior

Comments should still be there after transforming the AST.

@lrabinowicz lrabinowicz changed the title Comments before "}" are removed after transforming the AST Comments removed after transforming the AST Apr 23, 2021
@weswigham
Copy link
Member

So, we don't track } and { in the AST, specifically - can you elaborate on what structure those tokens are actually a part of (eg, body of an if, or body of a function)? In some of your screenshots it's not clear.

@RyanCavanaugh
Copy link
Member

Duplicate #6982, #8800, etc.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Apr 23, 2021
@lrabinowicz
Copy link
Author

@weswigham I've updated the description with more information. Let me know if there is anything else I can add :) Thank you!

@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants