rust-lang / rust-lang/rust-analyzer
Support for same-prefix uses for merge-imports assist
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Follow-up from https://github.com/rust-analyzer/rust-analyzer/pull/3745#issue-394855923
I believe it might be a low-hanging fruit to add support for merging same-prefix uses as pointed out in linked PR:
use foo::Bar;
use foo::*;
transformed into after the assist call:
use foo::*;
There are few concerns I'd like to point out here:
- I've not investigated the effort which would have to be done to implement it.
- I'm not entirely sure if it's a responsibility of this assist
- There might be an edge case where separate
usealong with wildcard use makes something work(?)
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 reading the linked PR #3745 and locating the merge-imports assist and its existing tests. Check whether the assist owns same-prefix merging and investigate the wildcard-use edge case described here. Done means the assist transforms use foo::Bar; plus use foo::*; into only use foo::*;, with coverage for the relevant behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100