gumtree-spoon-ast-diff icon indicating copy to clipboard operation
gumtree-spoon-ast-diff copied to clipboard

How can I apply the diff actions on the left AST?

Open dareenkf opened this issue 4 years ago • 6 comments

I wonder if I can reconstruct the left AST by adding the diff resulted operations and then rewrite the code to a file.

dareenkf avatar Mar 04 '21 17:03 dareenkf

Hi @dareenkf I am not sure if I get your point. When you compute the diff, you have already the left and the right. So, there is no need to reconstruct any of those files. Did I misunderstood your point? Regards Matias

martinezmatias avatar Mar 04 '21 18:03 martinezmatias

Hi @martinezmatias , I mean that I want to apply the operations to the left AST, and then pretty print the new AST to a file.

dareenkf avatar Mar 04 '21 18:03 dareenkf

We haven't implement that feature yet. In any case, if you apply to file Left the operations from a diff obtained of comparing files Left and Right, then the result should be file Right, which you have it.

martinezmatias avatar Mar 04 '21 19:03 martinezmatias

I know that, however, I plan to modify some of the operations before applying them to the left AST. Any way thanks for you reply! I'll try to figure out a way.

dareenkf avatar Mar 04 '21 19:03 dareenkf

That's a feature we want to implement. If you want to try to implement it, it'd be nice, we can guide you :)

martinezmatias avatar Mar 04 '21 19:03 martinezmatias

FYI @algomaster99 is working on this feature

monperrus avatar Mar 06 '21 08:03 monperrus