-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Prefer non-prelude paths when suggesting import #15362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
As a side note there's a I'm writing a library with an exposed prelude and RA suggests only the prelude imports with no other alternative. @Veykril Since you implemented the feature, maybe you have an idea? |
Hmm, no that should work. Can you elaborate on the specific setup that runs into problems? It should be working if you set |
This is a cargo workspace with a few crates: + workspace/
├── .vscode/
│ └── settings.json
├── my-lib/
├── my-lib-macros/
├── my-lib-sys/
└── my-lib-tests/ RA version is The RA bits of {
"rust-analyzer.rustfmt.rangeFormatting.enable": true,
"rust-analyzer.imports.preferNoStd": true,
"rust-analyzer.imports.preferPrelude": false,
} Nothing too fancy... I do use imports from the main library prelude in the integration tests, but I'd rather not reference the prelude from the main library itself. |
As an example, Bevy's App struct can be found at both
bevy::prelude::App
andbevy::app::App
. I feel that if I am importingApp
specifically (i.e. not using a glob import on Bevy's prelude), then I would rather usebevy::app::App
. Yet rust-analyzer seems to only show me thebevy::prelude::App
path. I'd like it to prefer showing me thebevy::app::App
path (ideally it would list both, but the non-prelude path first).The text was updated successfully, but these errors were encountered: