-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add utility for retrieving full import paths #20
Comments
As discussed in #5, I'd think this crate should remain as a pure reexport of |
That's a fair choice, anybody willing to take that crate on? |
Just noticed this issue --
I don't have time to fully write up the You probably would need to use the Trustfall query engine to use it in the best way, unless you wanted to fork those crates and use the underlying code directly (which you are of course welcome to do if you don't mind maintaining a fork). |
Any update on this? Is it possible to retrieve the full import paths now? :) |
Only via I would be very surprised if the algorithm ever ships as part of If you're interested in reusing some of my work, I'd be happy to point you in the right direction. |
For completeness and future reference: The public-api crate also has this capability and is also an option for you. |
@obi1kenobi Yes, I'd be very interested in this functionality, it's totally fine with me if I have to depend on trustfall crates for this, I'd really appreciate if you can point me in the right direction 🙂🙏 |
Oh neat, I didn't know that
If you know you are working with a specific rustdoc format version (e.g. v34), you'd use the corresponding major version of
Of course now that you have Trustfall adapter, you can also use it to run Trustfall queries over the rustdoc as well — the same queries as in the playground. And if you aren't sure which exact rustdoc format version you'll get, the |
Two more notes:
#[doc(hidden)]
mod hidden {
pub struct Example;
}
// Users can import this as `my_crate::Example`,
// which does not pass through any `doc(hidden)` components.
// So this is public API!
pub use hidden::Example; |
To clarify: In the ExampleFor this crate: pub mod first_path {
pub fn the_item() {}
}
pub mod second_path {
pub use crate::first_path::the_item;
} All (both) paths to the public item are listed: $ cargo public-api
pub mod diff_test
pub mod diff_test::first_path
pub fn diff_test::first_path::the_item()
pub mod diff_test::second_path
pub fn diff_test::second_path::the_item() And we also handle infinite export loops. But we currently don't handle (The example use the |
As discussed in here: rust-lang/rust#104651 (comment)
It would be useful to provide a utility function to retrieve import paths for items.
The text was updated successfully, but these errors were encountered: