-
Notifications
You must be signed in to change notification settings - Fork 350
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
Bumped ast-types version #766
Conversation
I'm not sure how to fix the failing test... I looked through the code, but I couldn't identify what change I needed to make to handle the new types. Any pointers? |
My guess is that the new ast-types adds a new node type that recast doesn't know about? |
@eventualbuddha It's the new ChainElement and ChainExpression types, I'm just not sure how to make recast recognize new types |
I updated the test to work past this here: #769 |
@ethancrook99 The reason these tests exist is to ensure that the Recast pretty-printer is able to print the new AST types, so the conservative pretty-printing algorithm can fall back to generating valid (if somewhat reformatted) code wherever the original AST has been modified. Where the AST has not been modified, Recast is able to copy the original code directly to the output (give or take some reindentation). In other words, Recast can often get away with not actually knowing how to print unchanged AST nodes, but it will fail badly when AST nodes involving a If you need In short, the test failures are telling us that we need to add printer cases to |
@benjamn I can give it a shot! I'll let you know if I need any guidance |
I added possible implementations for the new types in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Close, should be easy to fix.
Thanks for putting in the remaining effort on this. I hadn't had a chance to review the patterns in play just yet and noticed the Apologies for the side-step @benjamn 👍 |
Wasn't there a test? Where'd that go? |
I never actually added the test, I couldn't figure out how to get it working properly. I put the code that I did have in my reply to the above thread though, if you have any suggestions on how to fix it then I'll add the test back in |
Can I get some guidance on how to make a test for |
I wouldn't worry about the semicolon thing specifically. Just have a test that generically prints a chain element. |
@eventualbuddha I added a couple of tests, looks like everything is working together nicely now |
@ethancrook99 @eventualbuddha Just published these changes to npm as |
No description provided.