Repository navigation
Decide whether a macro is defined yet at a reference in one place - #389
Merged
Merged
Conversation
Contributor
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 47 minutes. View limit details
|
The analyzer's macro_resolves_at_reference and the providers' macro_resolves_at_position held the same visibility_start, line, and same-line rules, with LOCKSTEP comments asking that every change be copied to both. The analyzer now applies its preorder-index check and then calls macro_resolves_at_position, so the rules exist once. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jbearak
force-pushed
the
refactor/one-macro-position-check
branch
from
November 5, 2026 20:56
3d58e11 to
16764d4
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.
The analyzer (for diagnostics) and the providers (for go-to-definition and references) each had a copy of the rule for whether a macro is defined yet at a reference. Each copy had a LOCKSTEP comment asking that every change be made to the other too. If the copies drifted, a diagnostic could call a macro undefined while navigation resolved it, or the other way round.
The analyzer now runs its own preorder-index check, then calls the providers'
macro_resolves_at_positionfor thevisibility_start, line, and same-line rules. This deletes two helpers and the LOCKSTEP note. Behaviour is unchanged: every caller passes a range whose start line is the reference line. The old code compared range starts only, as the shared function does. A reference with only a line maps to the end of that line, which reproduces the old line-only branches.Proof: typecheck, lint, and
bun test ./testspass, except theseverity-settingsproperty flake fixed in #388.Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved
Created with Claude Opus 5.5 in T3 Code.