You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we're doing replacement on code through the AST we always need to use insert_before, insert_after, replace methods that all follow the same method signature receiving a code range to replace in the original file.
The idea here is to build a small language to build these code blocks from simple strings.
and it would allow us to use the command line with refactoring mode:
fast "(send nil create ...)" --replace "s/${selector}/build_stubbed/"
For simple code changes it will be very useful. I'd love to hear opinions about it and what syntax would make us get rid of ruby blocks from refactorings with no worries.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When we're doing replacement on code through the AST we always need to use insert_before, insert_after, replace methods that all follow the same method signature receiving a code range to replace in the original file.
The idea here is to build a small language to build these code blocks from simple strings.
The following code:
with the following expression:
Or something attached to the node pattern:
Or something like a method of a node:
and it would allow us to use the command line with refactoring mode:
For simple code changes it will be very useful. I'd love to hear opinions about it and what syntax would make us get rid of ruby blocks from refactorings with no worries.
Beta Was this translation helpful? Give feedback.
All reactions