-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Hide doc(hidden)
items from auto suggestions
#7718
Comments
This could probably be lumped in with #824. |
9681: Respect `#[doc(hidden)]` in dot-completion r=jonas-schievink a=jonas-schievink This adds `CompletionContext::is_visible` as a convenience method that checks visibility, presence of `doc(hidden)`, and whether the completed item is in the same crate as the completion site or not. We only complete `doc(hidden)` items from the same crate. This doesn't yet work for *all* completions: `qualified_path` completions use `Module::scope` and `ScopeDef`, which doesn't work with this. Part of #7718 Co-authored-by: Jonas Schievink <[email protected]>
|
@jonas-schievink The source code says |
The re-export is hidden, not the trait. |
Soo if the reexport is hidden, does that mean we don't want to import |
That's what I would expect. |
What's the intention of these reexports then? |
This example imports |
That's blocked on recording imports in the hir then I believe. cc #9197 |
TBH, I think the intention was to use the re-export (otherwise why would it be there, and it's a common pattern to export shorter paths). But on the other hand, it makes sense for the documentation to sit next to the implementation, so I'm not sure what would be best here. |
Yeah, I think my point is that it seems the situation with |
Yeah, I feel the same way. Maybe there should be another attribute saying "use this other path instead of this one". CC @jyn514 maybe. Just so you won't have to re-read the whole thing, the problem is that most of the time, Two solutions I can think of would be:
|
This seems like a bug in the crate? Why would you annotate the item with |
As another example, warp re-exports a lot of it's filters at the root, to allow for convenient usage ( All the examples in warp show using the shorter import. I don't see that as a bug in warp, but as a way to direct the way a user finds the docs, in an attempt to not overwhelm them. |
@seanmonstar I have the same question though: why not use doc(no_inline)? That still shows the imports are available without adding all their docs to the main page. Currently it sounds like the docs for hyper aren't consistent with the examples. |
This is why. |
For example, rust-analyzer suggests using
futures::FutureExt
, which is not publicly documented: https://docs.rs/futures/0.3.12/futures/?search=FutureExt.The text was updated successfully, but these errors were encountered: