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

[bug] virtual nodes do not have position

Open martinezmatias opened this issue 5 years ago • 1 comments

The virtual nodes should have the position inferred from the children or parent (depending the case). For example, for the virtual that groups modifiers, the start position should be taken from the first modifier, and the end position from the end position of the last modifier.

martinezmatias avatar Sep 01 '20 08:09 martinezmatias

It can be fixed as the FakeTree does: https://github.com/GumTreeDiff/gumtree/blob/1439d6657bbb5ce6aad6db261fbaa57fc811b7eb/core/src/main/java/com/github/gumtreediff/tree/FakeTree.java#L54

(However, note that we cannot use FakeTree for virtual nodes, because FakeTrees do not have matadata, and our virtuals need to have metadata to point to the ctelements)

martinezmatias avatar Sep 01 '20 11:09 martinezmatias