Use case
A crate (lib) I'm working on provides a global prelude module, from which programmers can quickstart the usage of the crate by doing crate_name::prelude::*;.
Internally though, I want to avoid relying on the prelude re-exports, and choose their original location instead and makes those imports independent from changes to the prelude's re-exports.
Unfortunately, completion suggestions from rust-analyzer will always suggest the shortest path to an item that is not yet imported.
Potential solutions
- Option to ignore re-exports
- Option to ignore a list of modules' re-exports
- Option to ignore a list of specific re-exports
- Option to enable prompting for disambiguation when multiple paths to an item in the same crate exist
- Option to "canonicalize" an import (i.e. "rephrase" an import path that uses a re-export to an import path to the original location of the item)
Thank you for considering this feature :)
PS: May be related to #20468 , but I'm not certain that it's about the same thing, as they talk more about external modules rather than internal re-exports.
Use case
A crate (lib) I'm working on provides a global prelude module, from which programmers can quickstart the usage of the crate by doing
crate_name::prelude::*;.Internally though, I want to avoid relying on the prelude re-exports, and choose their original location instead and makes those imports independent from changes to the prelude's re-exports.
Unfortunately, completion suggestions from
rust-analyzerwill always suggest the shortest path to an item that is not yet imported.Potential solutions
Thank you for considering this feature :)
PS: May be related to #20468 , but I'm not certain that it's about the same thing, as they talk more about external modules rather than internal re-exports.