-
Notifications
You must be signed in to change notification settings - Fork 12.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
rustdoc: search should prioritize matching capitalization #119480
Comments
It might also make sense to make this based on whether there were capital letters in the user's input. Vim has a similar feature that can be enabled, where searching with all lowercase is case-insensitive, but mixed-case is sensitive. In rustdoc's case, we could do something similar, except make it case-preferenced rather than exclude non-matching capitalization altogether. |
The Vim style is smartcase (ripgrep has a However, that is better for when you have binary results (either it matches or it doesn't), giving precedence to exact-case matches is better when you can rank the results. This is what e.g. https://github.com/kentcdodds/match-sorter does. (I would have liked this for adding a PATH alias in #119748) |
@rustbot claim |
…case, r=notriddle rustdoc: show exact case-sensitive matches first fixes rust-lang#119480
…case, r=notriddle rustdoc: show exact case-sensitive matches first fixes rust-lang#119480
…case, r=notriddle rustdoc: show exact case-sensitive matches first fixes rust-lang#119480
…case, r=notriddle rustdoc: show exact case-sensitive matches first fixes rust-lang#119480
…case, r=notriddle rustdoc: show exact case-sensitive matches first fixes rust-lang#119480
…case, r=notriddle rustdoc: show exact case-sensitive matches first fixes rust-lang#119480
Rollup merge of rust-lang#129430 - lolbinarycat:rustdoc-search-exact-case, r=notriddle rustdoc: show exact case-sensitive matches first fixes rust-lang#119480
reopening this because it's only fixed in the simplest case, if you use a full path it will not be fixed. |
It's good that rustdoc's search is case-insensitive, to make it easier for people to find what they're looking for. However, if the user types in capitalization that exactly matches (or more closely matches) a given type, rustdoc's search results should prioritize that type over things that don't match in case.
For example, https://doc.rust-lang.org/std/?search=Copy (note the capital
C
) should liststd::marker::Copy
at the top, notstd::fs::copy
.The text was updated successfully, but these errors were encountered: