rust-lang / rust-lang/rust-analyzer
Prefer non-prelude paths when suggesting import
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
As an example, Bevy's App struct can be found at both bevy::prelude::App and bevy::app::App. I feel that if I am importing App specifically (i.e. not using a glob import on Bevy's prelude), then I would rather use bevy::app::App. Yet rust-analyzer seems to only show me the bevy::prelude::App path. I'd like it to prefer showing me the bevy::app::App path (ideally it would list both, but the non-prelude path first).
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 reproducing the import suggestion for Bevy's App and trace rust-analyzer's import path selection and ranking. Done means a specific import prefers bevy::app::App over bevy::prelude::App, while considering whether both paths should be listed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100