-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Maintain writer.js or not? #109
Comments
Yeah, we should probably maintain it. |
My original reason to maintain the writer seems circular.
The writer really seems to be a formatter (as |
Creating a WebIDL extension for VSCode with formatting feature may be fun, though 😄 |
I have a use case where I need to parse IDL, make a few changes to the AST and print it back out with the original formatting intact. While I'm currently not able to use writer.js for this due to a few problems with the output (in addition to the selective whitespace retention mentioned earlier), a maintained writer.js would be very helpful for this purpose. |
@Zirro Thank you for sharing your use case! Could I ask you the purpose of making those AST changes? |
@saschanaz Sure, it is for an IDL differ/merger to be used while developing jsdom. The tool would make it possible to compare and merge our current IDL files against the latest spec, while ignoring/restoring the changes we have made such as adding custom extended attributes or placing unimplemented properties behind comments. After doing a few too many manual changes as part of jsdom/jsdom#2053, I hope to fully automate the process the next time. |
So it seems we should reconsider how |
I'm not fully understanding what @Zirro needs exactly, but I'm happy for us to enhance or change "ws" to accept additional options if need be :) |
The parser should provide an option to store every whitespace it meets so that one can reconstruct the whole original IDL text with the parsed result. This way one may programmatically modify some IDL types without losing whitespaces. |
Oh, I was under the impression it was already doing that. If |
Currently |
Will release soon. Travelling atm. |
It's currently not being exposed for Node package, so probably no need to release this time. |
Looking at the git logs, the
ws: true
option is to enable the writing feature. It will be great to write a whitespace test with the writer (as we can just parse, write, and check the text is intact) but writer.js is currently not being maintained anymore. Should we maintain it or not?The text was updated successfully, but these errors were encountered: