-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Improve Command Palette search experience for word permutations #99685
Comments
Related issues: #27317 |
@bpasero You mind if I try to tackle this in the next few weeks if no one beats me to it? |
Yeah maybe. One fear I always have in this area is that people might have build up muscle memory how command palette works. Now you want to change that filter logic and users that have typed certain commands might now get something totally different selected by default. So I think this can only be a setting for more fuzzy search in commands? |
Mhm that's an option, an alternative would be maybe to opt-in to keywords only if there would have otherwise not been any search results. This will be "backwards compatible" with the old search. |
Another option: give the "new" results less weight so they would appear last. |
Yeah that sounds like a good direction. Maybe quickly check what #27317 is talking about already with respect to command palette to gather more ideas: The filter/sorting logic is here:
We typically also want to preserve alphabetical sorting to not confuse muscle memory. That would probably conflict with the idea of putting those results last. |
I agree 👍 I therefore suggest the following as a one-size-fits-all solution for all the items, would love to hear your thoughts:
Pros:
Cons:
|
Maybe this is too complicated and we should simply allow "foo bar" to match either a command "foo bar" or "bar foo", I wonder how big the change would be in the end. The algorithm would then be:
This is still not fuzzy matching, e.g. typing "gstash" would not match "git stash". I was mainly worried that enabling fuzzy matching would potentially conflict with built muscle memory, but I am less worried about word permutations the more that I think about it? |
There is still the problem of users having their "muscle memory" compromised if we implement what you suggested no? |
Yeah you are right, but what if that would only apply if no commands are otherwise found? |
Yeah that or ranking them lower, after the first ones as I mentioned before, for which no results is a private case. WDYT: only if no results or with less weight? |
The problem with "ranking them lower" is that you suddenly no longer have commands sorted in alphabetic order. We do that on purpose so that commands with the same prefix are close to each other. |
When searching with the Command Palette, right now you can use fuzzy search which is great.
Searching for "pop stash" or similar will bring up
Git: Pop Stash...
from the native Git extension.Searching for "stash pop" however, will not.
I frequently search for "stash pop" instead of "pop stash" and it doesn't match since it expects the word in order. That is just a contrived example, I am sure that there are better ones.
Anyway, not sure whether this is a good idea just in my eyes, but in some cases I think it would be useful if the words could be out of order.
This could be implemented using keywords (for secondary search in case there are no matches) or implementing the out of order functionality. If performance is an issue, you could opt for this search heuristic lazily in cases where there are no results without it.
The text was updated successfully, but these errors were encountered: