-
Notifications
You must be signed in to change notification settings - Fork 0
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
Restructure internal state #71
Comments
Most importantly in my mind, it would also avoid removing jsdoc comments that were not added by the rewriter, which the current #70 does. |
Does the rewriter drop all comments? I just checked and we have no tests that check for preseving comments. |
Currently the rewriter drops JSDoc comments which prefix variable statements. This is a pattern I don't believe we use often in LAPIs, but if we choose to these should be preserved. Tests and implementation need to be added to ensure normal comments and non-rewritten JSDoc comments are preserved. |
What does it do to non-JSDoc comments? |
Nevermind, I played with the tests, I can see it preserves normal comments. |
Currently the rewriter holds onto internal state in the form of a list of imports, which are accumulated and added to each file at the end of its rewrite. With the introduction of JSDoc comments in #70, there is new information to be accumulated during the rewrite and operated on at the conclusion.
Currently, the JSDoc removal happens with another pass through the descendants of the sourceFile, but it would be more efficient to track the additions and remove them as part of the internal state at the end. This refactor, coupled with a refactor of the imports into a more organized
Import
class, would straighten out the state mechanism the rewriter uses, organize the individual components of that mechanism, and remove an inefficient additional traversal.The text was updated successfully, but these errors were encountered: