Open mohayemin opened 11 months ago
I am not a fan of referencing the target tree in the edit script. I would prefer if the edit script is only dependent on the tree for which it was computed for.
In addition, finding the subtree which is related to specific operation is not always possible (e.g. what is the related subtree for Move or Delete operations?)
If you are only interested in the update operation, you could compute the edit map (see code_diff/gumtree/init.py#L23 ). Whenever there are two nodes with different labels in the edit map, we would generate an update operation (+ some adjustments of the child nodes).
I have a use case where I need the information of the target nodes in the EditScript. However, only the target node text is passed to the
Update
objects. For example the code atcode_diff/__init__.py:L200
isI suggest that the last line to be replaced with: