-
-
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
feat: record positions of each node in Tree #325
Conversation
No tests fail right now because we never really tested for positions. |
thanks a lot @algomaster99 let's add a new test case then! |
@pouryafard75, I have added some preliminary tests to ensure things are working. Please try them out with your use case and report bugs. I will work more on this during weekend and then finally merge. |
I have created tests which checks the following behavior:
The tests fail for 3 because INRIA/spoon#5980. EDIT: It can be zero length, see INRIA/spoon#5980 (comment). |
@monperrus this is ready for merge. |
thanks a lot @algomaster99 |
Fixes #323
We record start and end position characters in each node in the Gumtree tree. Thankfully, Spoon nodes provide this information in these two APIs.
Most of the nodes in Spoon are visited in
TreeScanner
and they are added to Gumtree AST. However, there are many more nodes created inNodeCreator
for which I have added the position manually. Hence, they require testing. This is why I am marking this PR as draft right now. I will add some tests soon and then merge. @pouryafard75, please try out this PR and report any bugs in the positions you get. It will also help me write tests. :)