Skip to content

Newly constructed document context may get the wrong node #778

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

Closed
jennybc opened this issue Apr 16, 2025 · 0 comments · Fixed by #805
Closed

Newly constructed document context may get the wrong node #778

jennybc opened this issue Apr 16, 2025 · 0 comments · Fixed by #805
Assignees

Comments

@jennybc
Copy link
Member

jennybc commented Apr 16, 2025

We're teasing this buglet out of #770

When completions are triggered on, for example, an empty line, the current point isn't inside a syntax node. Or, rather, it's only inside the enclosing 'Program' node, which is sort of a degenerate case.

find_closest_node_to_point() will then latch on to a nearby node in some cases when it should not. (Which then interacts poorly with our completion logic, which is what #770 about.)

Image

Above, I've triggered completions on an empty line, but according to the document context, the completion node is the closing paren ) of the line above.

We suspect this may be an edge case that hasn't been accounted for, i.e. that the current behaviour is unintentional. I'm going to see if we can change/fix this without breaking other things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant