rust-lang / rust-lang/rust-analyzer
Rust-analyzer freezes VS Code GUI when hovering over variable with long type
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
I was testing a parser combinator library called chumsky and noticed that hovering over variables with very long types causes the whole VS Code to freeze for a couple of seconds before the pop up window appears. The CPU usage of VS Code jumps from 1% to 10% and the memory usage also spikes.
The repository is this, as you can see it's quite a small project. To replicate the performance problems just go to the bottom of parser.rs and hover over "definition".
My CPU is a AMD Ryzen 5 1600X 3.60Ghz and I have 8 GB of RAM.
Here you can see a video of VS Code freezing
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
Reproduce the issue in parser.rs from the linked Sagrel/lang revision by hovering over "definition" at the bottom of the file. Start by profiling the hover path while observing the VS Code freeze and CPU or memory spike. Done means long Rust types no longer cause a multi-second GUI freeze before the hover popup appears.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100