-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offsets are problematic in the presence of comments #336
Comments
Also there are some subtrees, with [0,0] as offsets. Does it mean something? |
thanks for the bug report. This probably comes from the advanced algorithm in Spoon to attach comments to elements. It has gone over many iterations. indeed it may be argued that the comment is semantically part of the method. If we change for your case, it may break somebody else's case. are comments relevant in your experiment? one option would be to diff without comment. |
@monperrus Does Spoon have a mode that disables the parsing for the comments? This could help me get the correct offsets. |
Because I am actually running it as |
Hello, while evaluating Spoon with cases from our benchmark, I encountered a recurring and serious issue:
Leads to the following tree:
The offset for Method: run [26,103] is problematic due to the presence of the comment. Specifically, the non-JavaDoc comment is unnecessarily affecting the method's offset. Since this is not a JavaDoc comment, it shouldn't influence the method's boundaries.
Notably, GumTree's JDT visitor behaves correctly, as seen here where the comment does not impact the method's offset:
I rely entirely on offsets to evaluate tools, and this minor discrepancy is causing significant conflicts. It would be very helpful to have a workaround or a fix for this issue so that comments like these do not affect method offsets.
The text was updated successfully, but these errors were encountered: