Skip to content

Find names with Unicode letters under the cursor again, keep Find References on a program call to the program and on a local to its own program, find locals an autoloaded ado sets, and drop programs at clear all - #433

Merged
jbearak merged 4 commits into
mainfrom
t3/fix-navigation-provider-regressions
Nov 19, 2026

Conversation

@jbearak

@jbearak jbearak commented Nov 19, 2026

Copy link
Copy Markdown
Owner

A cold review of #430 and #431 before the release found navigation regressions on main. After #430 the lexer reads café as one word, but Go to Definition, Hover and Find References still scanned the word under the cursor as ASCII, so they returned nothing on it. After #431, Find References on a call to a program that sets a caller local with c_local returned the local's read in place of the program's references. It also pooled same-named locals across programs and missed locals that an autoloaded ado sets.

Now the providers read the word under the cursor the way the lexer reads a name. Find References uses the same credited writes as Go to Definition, keeps them to the read's program frame, and leaves a literal c_local out of the word-under-cursor check.

Fixed

  • uni-nav: Go to Definition, Hover and Find References on a variable, local macro or program name with Unicode letters (café, `année', résumé). The scanners in definition, hover, references and completion, and macro completion (`anné, $café), now use the name characters from src/utils/stata-name.ts. The outline's program-name selection no longer relies on \b (which misses the end of café). A cursor past the end of a line still walks back to the last word, as before.
  • up: Find References on makeflag returns the declaration and both calls (lines 1, 4, 5). A literal c_local write spans the whole call, so it no longer takes over from the program under the cursor. The read of done still finds both calls.
  • fr: Find References from the read of done in first returns lines 5 and 6. second's separate local (line 9) is no longer included.
  • checked: Find References from the read and from the argument both return lines 3 and 4. They now get the workspace symbols Go to Definition uses, so they find setter.ado. ac moves the same way (same cause, now matching Go to Definition and 9f94055).
  • cond: in if 1 version 18: save l.dta, dta is no longer a use of a variable. The file-name check now sees through version N: after a one-line if.
  • clearall: clear all drops programs from memory, so a later call autoloads the ado. The undefined-macro warning goes away and navigation finds the argument. (program drop _all already worked.)

Not fixed

  • clearfile: a program drop run by a child do-file does not carry back to the caller. That needs cross-file state, not a few lines.
  • uncalled: a run inside a program body that is never called still counts as loaded. Telling apart called and uncalled bodies is more than a few lines.
  • Go to Definition and Hover on the argument word in checked/ac (setter result) still return nothing. 9f94055 returned them. This is outside the listed cases.
  • Hover and Go to Definition on l.dta in cond still report variable dta. Only Find References was in scope.
  • Other completion patterns are still ASCII-only: the extended-macro-function context (local x : word count …), the option prefix after a comma, and the command word at line start.

Proof: each fixed case has a focused test that fails on origin/main and passes here (10 tests). The review's repro.sh outputs before and after show only the cases above changed (clearfile, uncalled, braced, fmtdrift, option are byte-identical). The base-ado corpus check shows nothing added or removed (30118 records). check:line-endings, typecheck, bun test ./tests (10348 pass), lint and test:ci all pass, each run separately.

…es on a program call to the program, keep credited locals to the read's program frame, find locals an autoloaded ado sets, and drop programs at clear all
…e workspace-coverage mock indexer its symbols
@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 52 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 86 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: ed6b0b68-9dbe-427d-a4e3-9e7dfaaebdb9
Commits

Reviewing files that changed from the base of the PR and between fc25dc8 and 7c6ae60.

Files selected for processing: 14

  • docs/find-references.md
  • src/analyzer/program-macro-writes.ts
  • src/providers/completion.ts
  • src/providers/completion/macro-completion.ts
  • src/providers/cursor-word.ts
  • src/providers/definition.ts
  • src/providers/hover.ts
  • src/providers/program-macro-credit.ts
  • src/providers/references.ts
  • src/providers/symbols.ts
  • tests/integration/navigation-word-and-credit.test.ts
  • tests/integration/program-definition-precedence.test.ts
  • tests/property/find-references-workspace-coverage.prop.test.ts
  • tests/unit/references-factor-variables.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@jbearak
jbearak merged commit dd07f05 into main Nov 19, 2026
16 checks passed
@jbearak
jbearak deleted the t3/fix-navigation-provider-regressions branch November 19, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant