-
Notifications
You must be signed in to change notification settings - Fork 2k
Option for import path when re-exports exist — preferences/excludes #21914
Copy link
Copy link
Open
Labels
A-idegeneral IDE featuresgeneral IDE featuresC-featureCategory: feature requestCategory: feature request
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-idegeneral IDE featuresgeneral IDE featuresC-featureCategory: feature requestCategory: feature request
Type
Fields
Give feedbackNo fields configured for issues without a type.