rust-lang / rust-lang/rust-analyzer
The Semantics API is prone to panics
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
We tend to have a lot of IDE features randomly panic simply because a node that is being used in a lookup is not cached in the parse tree cache. This is really annoying and keeps getting worse and better every few weeks. We ought to remodel the APIs involved to either make this practically impossible (any node that may be produced immediately being cached) or have the cache be redundant for lookups (passing the corresponding file ids, making the find_file internal function obsolete).
The former would be nicer in terms of usability, but the latter will ensure the problem from not occuring anymore (unless the file id is mismatched but that's is a lot more difficult to run into than it is to not cache a node).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the Semantics API lookups that rely on the parse tree cache, focusing on nodes that can be produced without being cached. Compare the two proposed directions: ensuring produced nodes are cached or passing file IDs so the internal find_file function is unnecessary. Done means IDE features no longer panic when a lookup node is absent from the cache.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100