rust-lang / rust-lang/rust-analyzer
UX: highlight the diff when a signature mismatch occurs
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Today I made a typo in my function signatures. It took me longer than I wanted to identify I was missing an &mut. The command line output of rustc handles this rather nicely: it renders the mismatched signatures using bold text. It'd be great if rust-analyzer could similarly apply render tricks to draw attention to the diff.
Another thing that stands out is that the signature diffs in rust-analyzer are not aligned, which makes it harder to scan for differences. I'm not sure to which degree VS Code allows for this, but if it it's at all possible it would be a huge boon.
Thanks!
Screenshots
Command line output
The missing &mut stands out clearly here and I can proceed immediately to fixing it. Also notice how the signatures are aligned.

Rust-analyzer output
Spotting the missing &mut took me about 30 seconds, getting me out of my flow of writing code.

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 investigating rust-analyzer’s signature-mismatch diagnostic rendering and the VS Code/LSP capabilities mentioned in the report. Done means differing signature text is visually emphasized and the signatures are aligned enough to scan, matching the improvements illustrated by the supplied screenshots.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- developer-experience, devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100