Skip to content

Rustdoc: prioritize matches with same casing in search results #69025

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

Open
Kinrany opened this issue Feb 10, 2020 · 9 comments
Open

Rustdoc: prioritize matches with same casing in search results #69025

Kinrany opened this issue Feb 10, 2020 · 9 comments
Assignees
Labels
A-rustdoc-search Area: Rustdoc's search feature C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Kinrany
Copy link
Contributor

Kinrany commented Feb 10, 2020

It would be convenient if the results for a lowercase filter showed exact match filter before Filter, and vice versa.

@jonas-schievink jonas-schievink added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 10, 2020
@GuillaumeGomez
Copy link
Member

I can do that but not sure we really want it... People really look for "String" I think, instead they just look for "string" and that's it. You can specialize it by adding "struct:" or "fn:" (the full list is available on the rustdoc help) at the start of your query.

@Kinrany
Copy link
Contributor Author

Kinrany commented Feb 10, 2020

Typing the name with the correct casing is easy, and the behavior of displaying exact matches first should be very clear, so I expect everyone to immediately learn to tune the results when they know exactly what they're looking for.

In other cases any order seems fine, unless looking for types is much more common than looking for functions?

@oOBoomberOo
Copy link

In other cases any order seems fine, unless looking for types is much more common than looking for functions?

I typically look for Struct and Trait much more than a function itself since I sometime forgot some implementation inside that struct.

@GuillaumeGomez
Copy link
Member

So like I said, I don't think this is a good idea. If more @rust-lang/rustdoc could give their opinion?

@kinnison
Copy link
Contributor

I'd say it's not unreasonable to put exact match first if it's available, then exact match case-insensitive, and then everything else by whatever relevant ordering we currently do. It won't make it harder for most people, and may help a small few. Of course, I also don't think it's that high a priority. Perhaps a good help-wanted issue?

@Kinrany
Copy link
Contributor Author

Kinrany commented Feb 19, 2020

Makes sense to me, and I'd be happy to send a PR if it was decided that this change is welcome 🙂

@GuillaumeGomez
Copy link
Member

Well, people seem more favorable to it so feel free to send a PR.

@camelid camelid added the A-rustdoc-search Area: Rustdoc's search feature label Oct 17, 2020
@lolbinarycat lolbinarycat self-assigned this Nov 6, 2024
@lolbinarycat
Copy link
Contributor

this was half fixed in #129430, but not for the case where people are searching paths (eg. serde::Serialize) instead of just type names (eg. String)

It's unclear if the path case is common enough to warrant fixing.

@Kinrany
Copy link
Contributor Author

Kinrany commented Nov 6, 2024

Thank you! I'm afraid I've forgotten about this one completely 😔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-search Area: Rustdoc's search feature C-enhancement Category: An issue proposing an enhancement or a PR with one. 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

7 participants