Repository navigation
Improve cross-reference completion support - #155
Merged
Merged
Conversation
ssmifi
approved these changes
Oct 21, 2026
ssmifi
left a comment
Collaborator
There was a problem hiding this comment.
Nice improvement, thanks. I mostly have doc/naming nits. Keep it rolling.
msujew
force-pushed
the
msujew/completion-fixes
branch
from
October 21, 2026 20:59
1faa7e1 to
e65f8de
Compare
msujew
force-pushed
the
msujew/completion-fixes
branch
from
October 21, 2026 21:05
e65f8de to
c3061c8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improves how the completion engine determines the owner of a cross-reference at the cursor. Previously, we derived the owner from a synthetic chain built from the completion parser's rule stack. That chain had no connection to the AST that the main parser built, so scope providers that depend on the container of the owner or its containment data returned the wrong symbols (or none at all).
This change builds the owner from the node that owns the token in front of the cursor, combined with the rule calls between that token and the cross-reference. The owner is either an existing node of the AST or a new node with the container and the containment data that the main parser would give to it. This means that scope providers see the same picture as they do for a regular node.
Also simplifies a lot of the internal machinery/API in the completion system. 90% of the changes are in the generated files though. In the same vein, I've restructured the completion test language: every rule has a descriptive keyword instead of a single letter, and I've added new rules for a bunch of test cases.