Skip to content

Use Salsa infrastructure for find-references and rename#1257

Open
lionel- wants to merge 7 commits into
oak/salsa-18-goto-def-migrationfrom
oak/salsa-19-find-refs-rename-migration
Open

Use Salsa infrastructure for find-references and rename#1257
lionel- wants to merge 7 commits into
oak/salsa-18-goto-def-migrationfrom
oak/salsa-19-find-refs-rename-migration

Conversation

@lionel-
Copy link
Copy Markdown
Contributor

@lionel- lionel- commented Jun 5, 2026

Branched from #1254
Progress towards #1212
Closes #1149

This PR moves find-references and rename onto the Salsa infra and deletes the old implementation (the textual workspace walk).

Candidate search: Unlike Rust-Analyzer that does a textual search across the workspace and resolves all occurrences, we're more aligned with ty: we filter files to inspect with a textual search, but then use a post-parse structure to filter occurrences. ty walks the AST, we walk the index instead with a new uses_of() method that is more to the point than the raw AST.

Candidates are then narrowed with File::resolve_at() to check that they match the definition of the symbol at point.

New supporting infra:

  • Salsa-based Identifier::classify()
  • all_files() (Salsa query) that returns all files known to the database
  • root_by_file() that disambiguates to which workspace root a file belong when roots are nested. That is meant to be the one source of truth for root ownership of files.

Removed infra: The Document copies of the Rowan parse tree and semantic index are now removed, in favour of the Salsa DB.

Other fix: Goto-definition now benefits from the new Salsa-based Identifier::classify() which snaps the cursor to the symbol at point. Fixes goto-def when cursor in on RHS boundary.

I recommend testing with #1259 to benefit from bug fixes and improvements in ulterior branches.

@lionel- lionel- force-pushed the oak/salsa-19-find-refs-rename-migration branch from 11d6ce1 to 31b65be Compare June 5, 2026 09:09
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