-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Comments
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. |
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? |
I typically look for Struct and Trait much more than a function itself since I sometime forgot some implementation inside that struct. |
So like I said, I don't think this is a good idea. If more @rust-lang/rustdoc could give their opinion? |
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? |
Makes sense to me, and I'd be happy to send a PR if it was decided that this change is welcome 🙂 |
Well, people seem more favorable to it so feel free to send a PR. |
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. |
Thank you! I'm afraid I've forgotten about this one completely 😔 |
It would be convenient if the results for a lowercase
filter
showed exact matchfilter
beforeFilter
, and vice versa.The text was updated successfully, but these errors were encountered: