Skip to content
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

It would be nice if when RustDoc search finds only one result it goes there #50216

Closed
gilescope opened this issue Apr 25, 2018 · 4 comments
Closed
Assignees
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@gilescope
Copy link
Contributor

As a dev,
it would be great if when I pasted in a type e.g. 'AngleBracketedGenericArguments' that returned exactly one result,
then the rust doc website would go straight to the single result (E.g. https://docs.rs/syn/0.13.1/syn/struct.AngleBracketedGenericArguments.html )
rather than showing me a found list of one item (E.g.
https://docs.rs/syn/0.13.1/syn/struct.AngleBracketedGenericArguments.html?search=AngleBracketedGenericArguments )

(Loving the in-built search functionality btw! <3 )

(A-rustdoc, C-enhancement, T-dev-tools-rustdoc)

@GuillaumeGomez
Copy link
Member

Since you're not the first one to ask for it, I think I'll just add a settings so you can have this behavior (I don't want it by default).

@GuillaumeGomez GuillaumeGomez self-assigned this Apr 25, 2018
@GuillaumeGomez GuillaumeGomez added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Apr 25, 2018
kennytm added a commit to kennytm/rust that referenced this issue Apr 27, 2018
…=QuietMisdreavus

Add setting to go to item if there is only one result

Fixes rust-lang#50216.

r? @QuietMisdreavus
@Ixrec
Copy link
Contributor

Ixrec commented Jun 24, 2018

Personally, I wouldn't want opening a search link with only one result to auto-redirect, but I would like pressing Enter in the search bar for a search with one result to auto-redirect. Is that a good enough compromise to avoid the need for a setting, or is that also controversial?

@gilescope
Copy link
Contributor Author

Works for me. I have too many settings in my life already...

@GuillaumeGomez
Copy link
Member

@Ixrec: Then press enter twice and you'll have the first result I suppose. I don't want to change the current behaviour. You have a search, you get results. There is only one result and you want to go to it without seeing the results page? Set your setting to such behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants