rust-search-extension
rust-search-extension copied to clipboard
Search should be case sensitive
Expected Behaviour
- I type in
rs Eq
. - I hit enter.
- I am taken to the docs for
std::cmp::Eq
.
Actual Behaviour (on Firefox for me at least)
- I type in
rs Eq
. - I hit enter.
- I am taken to the docs for
std::ptr::eq
.
This seems undesirable.
Hi @Victor-N-Suadicani. Thanks for the feedback. I personally think case-sensitive has more disadvantages than advantages. For example, most traits, and structs are CamlCase, the users prefer to input lowercase keywords to search it, such as refcell
for RefCell
.
So, I still insist on the case-insensitive search experience.
I think the proper solution would be to weigh exact (case-sensitive) matches higher, but still find the other (case-insensitive) matches.
As in, rs Eq
would still find both std::ptr::eq
and std::cmp::Eq
but Eq
should be at the top because it matches exactly, while eq
does not. Then searching refcell
would still find RefCell
(since there is nothing called refcell
, RefCell
would still be at the top).
Good idea. Thanks.
You could also implement smart case search where if you type an upper case character in the query, it enables case sensitivity in the search, otherwise treats it as case-insensitive.
This way it doesn't require exact matches and it's easier to find case-sensitive partial matches (like Once
=> OnceCell
).