rust-lang / rust-lang/rust-analyzer
How to prevent rust-analyzer importing duplicate or wrong items?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Hi,
I'm using rust-analyzer in neovim (lunarvim) and it works almost fine.
But in some cases when I already have some imported struct or enum from my own crates or libs ( for example customized Result or Error ) rust-analyzer auto completion adds unwanted and duplicated struct or enum from other cartes like serde or std.
every time it happens I face unexpected error in my file and when I check on top of my file I find some unexpected use lines added there.
Sometime it is really annoying as it repeads several times during editing code.
So please help me find how I can prevent rust-analyzer from this action or at least prevent duplicate same name import?
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 rust-analyzer through Neovim or LunarVim with custom Result or Error types and completion enabled. Check when completion adds unexpected or duplicate use lines from serde or std; done means the reproduction is explained and a way to prevent the unwanted imports or duplicates is identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- neovim, rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100