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

Search should be case sensitive #194

Open
Victor-N-Suadicani opened this issue Sep 5, 2022 · 4 comments
Open

Search should be case sensitive #194

Victor-N-Suadicani opened this issue Sep 5, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@Victor-N-Suadicani
Copy link

Victor-N-Suadicani commented Sep 5, 2022

Expected Behaviour

  1. I type in rs Eq.
  2. I hit enter.
  3. I am taken to the docs for std::cmp::Eq.

Actual Behaviour (on Firefox for me at least)

  1. I type in rs Eq.
  2. I hit enter.
  3. I am taken to the docs for std::ptr::eq.

This seems undesirable.

@Folyd
Copy link
Member

Folyd commented Sep 5, 2022

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.

@Victor-N-Suadicani
Copy link
Author

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).

@Folyd Folyd added the enhancement New feature or request label Sep 5, 2022
@Folyd
Copy link
Member

Folyd commented Sep 5, 2022

Good idea. Thanks.

@13k
Copy link

13k commented Apr 6, 2023

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants