-
Notifications
You must be signed in to change notification settings - Fork 339
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
Duplicate cursor while working with Java visitors #3641
Comments
I propose to switch the cursor creation call: from v.setCursor(new Cursor(cursor, tree)); to v.setCursor(cursor == null ? null : cursor.fork()); |
@BoykoAlex Thanks for reporting. This seems to be about commit 3086e52. It indeed looks like the after visitor's cursor will end up with a parent with the same value. @sambsnyd If I understand your commit correctly, you made a change to fix |
@BoykoAlex Rather than calling |
Using |
@knutwannheden reverting the commit or switching to |
The change in
TreeVisitor
:seems problematic and may lead to the creation of two cursors (child and parent) pointing to the same AST node.
The following call
t = (T) v.visit(t, p);
would create another cursor with the sametree
element it seems:Having a duplicate cursor leads to problems with indents in the auto formatting visitor.
The text was updated successfully, but these errors were encountered: