-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Emitted AST should optionally include comments #4165
Comments
@kdy1 this sounds like similar (not exactly same) discussion we had for plugin transform side comment support.
|
We can return a map in |
Any updates on this? |
If you see the issue does not have an update, that's reflecting the current state. Core team has small resources and sometimes cannot keep up all the feature improvement request from the community vs. internal priorities we are currently focusing. |
No worries! I just asked since I didn't find it in the milestone it was added to. |
so, this be solved? |
@kdy1 Was this ever implemented? |
@kdy1 I actually realized that the TypeScript compiler doesn't preserve comments in its AST either. I was looking at the advanced demo for the TSDoc API and realized they use the TS method I was hoping to do the same using Does this mean there's absolutely no way to extract comments from a file? |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Describe the feature
When using the parse method in the JavaScript lib
@swc/core
to generate AST, comments are not emitted. For example:Currently logs this, which notably does not contain the comment:
Of course, storing comments in the AST increases the size significantly, so it makes sense for this to be optional.
Having the comments in the AST is important to enable certain developer tools, so I would like to have it as an option.
Babel plugin or link to the feature description
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: