-
Notifications
You must be signed in to change notification settings - Fork 895
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
rustup doc
should support searching for names
#4165
Comments
@joshtriplett Thanks for your feedback! I do think we can always inject There's one caveat though: since the positional argument already has a meaning (path navigation), we should come up with a new syntax. Do you happen to have any proposal in mind? |
While it might make sense to have an argument to specify a query explicitly, what I'm looking for here is an automatic guessing of whether something needs a search. |
How would it know which document to search for |
Ideally, it does a search of std internally (rather than just forwarding the query), so that it knows there's a result to open. If an argument would otherwise error, and a search of std would produce some results, opening the search seems better than an error. |
@ChrisDenton That's not a problem since we focus on one book each time. Without any flags it'll be |
Ok, I think that'd work then? If the argument to So: if the user types EDIT: where the |
@ChrisDenton I still doubt whether we should do a FS-level search by ourselves since having to search in a range of 20K small text files (well, not all at once, but still quite a lot I think) might cause performance issues real quick... And sometimes a path component would mean a page, sometimes an anchor within a page. Forwarding to |
Hmm... does it need to be anything more than a simple file name check? That would be fast enough. True, it would be limited to finding top-level items but that seems like an acceptable trade-off and not mutually exclusive with having a full search command? |
@ChrisDenton #4069 asks for the |
I think having That would be easy enough to explain I feel. A positional argument searches for a "topic" (i.e. for a particular page) whereas |
Problem you are trying to solve
rustup doc
requires giving the exact path to an item in order to get its documentation. I'd love to writerustup doc File
rather thanrustup doc std::fs::File
.Solution you'd like
rustup doc File
should open the documentation forstd::fs::File
.This could work by doing the search in
rustup
, or by opening the rustdoc search page with a query ofFile
.Notes
No response
The text was updated successfully, but these errors were encountered: