rust-lang / rust-lang/rust-analyzer

Resolve vs Record

Open
#3,407 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-Architecture S-actionable
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

There are two principal ways an IDE can get semantic information.

  • By re-deriving it. When asked for goto definition for use foo::bar::baz, IDE asks for scope of the current module, and then resolves foo::bar::baz in this scope
  • By looking it up in a side-table. When compiler processes use foo::bar::baz, it records where the baz resolved to, and IDE picks this information.

We are currently mostly biased towards the first approach, but I feel we should move towards the second one long term.

See https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Architecture.20quetion.3A.20to.20remember.20or.20to.20compute for an extended discussion.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or code entry points are identified. Start by reading the issue and the linked Zulip discussion about remembering versus recomputing semantic information; the desired architecture and completion criteria still need to be defined.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.