GumTreeDiff / gumtree

An awesome code differencing tool
https://github.com/GumTreeDiff/gumtree/wiki
GNU Lesser General Public License v3.0
933 stars 174 forks source link

Srcml generator doesn't save positions #253

Closed illided closed 3 years ago

illided commented 3 years ago

When working with SrcmlJavaTreeGenerator (or any other srcml generator) pos and lenght are always -1.

I looked at the class responsible for converting trees to the gumtree format and there are a lot of code about position extraction. Maybe it was working on older version of srcML?

Screenshot from 2021-10-21 20-38-46

illided commented 3 years ago

Just checked: it works with 0.9.5 beta. Is it possible to make it work with 1.0.0?

jrfaller commented 3 years ago

That's strange, we have srcml 1.0 inside our CI and there is a test ensuring that positions are gathered : https://github.com/GumTreeDiff/gumtree/blob/main/gen.srcml/src/test/java/com/github/gumtreediff/gen/srcml/TestSrcmlJavaGenerator.java

Does this test pass on your system?

Cheers.

illided commented 3 years ago

My bad: I had 2.1.2 version of gumtree installed. Update to 3.0.0 solved the problem. Thanks for the test!