rust-lang / rust-lang/rust-analyzer
Dont return both "Remove all unused imports" and "remove the unused import" if both are the same
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
I added a keybinding that asks for only quickfix assists and applies it if there is only one. The problem is that for the unused import diagnostic rust-analyzer returns both "Remove all" and "remove", even if both have the same effect (specifically when there is only one unused import). It seems to me that if both code actions have the same edit we can ignore one.
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 at the unused import diagnostic's code-action generation, focusing on the "Remove all" and "remove" actions and their edits. Confirm how rust-analyzer represents and compares their edits, then verify that only one action is returned when the edits are identical while distinct actions remain available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100