Repository navigation
fix(references): Find All References on a ?Name field equate - #862
Merged
msarson merged 1 commit intoNov 17, 2026
Merged
Conversation
References on a ?Name control returned nothing. The word ladder dropped the ?, bailed outright on the sigil, and searched for a bare name that no symbol carries. A new terminal route resolves the field equate by the rule hover and F12 already use (FieldEquateResolver) and lists every ?Name in the file that resolves to the same control, so a same-named control in another procedure's window stays out and uses inside the local WindowManager class methods count. Ranges exclude the ?, so rename now rewrites USE(?Name) and its uses correctly. FieldEquateReferences.test.ts: 8 tests, all 8 fail without the fix. Full suite 4559 passing, 0 failing, 3 pending. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Find All References on a
?Namefield equateWhat happened
Hover and F12 resolve a
?Namefield equate to its control (#614), but Find All References on the same token returned nothing — from theUSE(?Name)declaration in the WINDOW and from any use in code:There was no quick way to get from a control in the window structure to the code that uses it.
Root cause
provideReferencesUnfilteredstarts fromTokenHelper.getWordRangeAtPosition, which treats?as a non-word character:With the cursor on the sigil the range is empty and the search stops. On the name it yields
OkButtonwithout the?, and the symbol ladder then looks for a symbol calledOkButton, which nothing declares.The fix
A terminal route ahead of the word ladder, the same shape as F12's #614 route:
provideFieldEquateReferencesresolves the cursor's?NamewithresolveFieldEquate(the hover/F12 rule), then walks the file'sFieldEquateLabeltokens with that name and keeps each one that resolves at its own line to the same control. That gives the compiler's scoping for free:?OkButtonin another procedure's window is a different control and is left out;enclosingProceduresto the procedure that declares the window, so it is included;?Namein a string or comment is never aFieldEquateLabeltoken.The declaration is the
?Nameinside the control'sUSE();includeDeclaration: falsedrops it. Ranges cover the name without the?, which is the word rename replaces, so rename on a field equate now rewritesUSE(?OkButton)and its uses toUSE(?SaveButton)etc., and leaves the other procedure's control alone.A window's controls are only visible to the procedure that declares it, so the search stays in the current file.
Testing
New
FieldEquateReferences.test.ts, 8 tests: from the declaration, from a body use (including?Name{PROP:...}), from a use inside a local class method, with the cursor on the?, the same name in another procedure,includeDeclaration: false, rename, and a colon-named equate (?LOC:Year:Prompt). All 8 fail without the fix (they return[]).Full suite: 4559 passing, 0 failing, 3 pending.
Live-tested in a real application: references from a BUTTON's
USE(?Name)in the WINDOW list itsOF ?Namehandler in the ACCEPT loop, and back.Scope
USE(Variable)are Hover/F12/references don't resolve field equates implicitly derived from USE() #455's subject. This route lists whateverresolveFieldEquateresolves, so it follows Hover/F12/references don't resolve field equates implicitly derived from USE() #455 through the same resolver; the declaration hit is only reported for an explicitUSE(?Name), since an implicit one has no?Nametoken to point at.🤖 Generated with Claude Code