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

Add fuzzy search to commands in palette #1964

Open
dubeg opened this issue Jan 12, 2016 · 16 comments
Open

Add fuzzy search to commands in palette #1964

dubeg opened this issue Jan 12, 2016 · 16 comments
Assignees
Labels
feature-request Request for new features or functionality quick-open Quick-open issues (search, commands)
Milestone

Comments

@dubeg
Copy link

dubeg commented Jan 12, 2016

As @bpasero suggested, I'm opening an issue to suggest adding fuzzy search in the palette for commands as well.

He had an issue with this though, so it could be enabled with a user setting. But I am unsure about his concern.

The issue with fuzzy matching is that you also need to do fuzzy sorting: more relevant results to the top. However for the command palette we chose to sort entries by name to keep the result list stable and memorable. Enabling fuzzy for commands would change the sort order for each search you do making it harder to learn the list of available commands.

I don't understand how the sort order is relevant when you are looking for a specific command or set of commands. Let's say I would like to look for all Markdown related commands (which start with Markdown:): in Sublime, I would only type md:, removing practically all unrelevant commands from the results list. The results however would still be sorted by names. Am I misunderstanding his issue?

Once you're used to search in a fuzzy pattern (often with shortened words like msg for message), it is very awkward to go back to typing complete words.

@bpasero
Copy link
Member

bpasero commented Jan 13, 2016

So you would do the matching fuzzy, but you would keep the sorting the way it is by name? I see that ST seems to apply fuzzy scoring also to commands.

@bpasero bpasero added workbench feature-request Request for new features or functionality labels Jan 13, 2016
@bpasero bpasero added this to the Backlog milestone Jan 13, 2016
@bpasero bpasero modified the milestones: Jan 2016, Backlog Jan 13, 2016
@bpasero bpasero self-assigned this Jan 13, 2016
@bpasero
Copy link
Member

bpasero commented Jan 13, 2016

Pushed a change to enable this and use our scorer for the sorting, lets see how it goes.

@dubeg
Copy link
Author

dubeg commented Jan 14, 2016

Ah! Well I find it much better now, thanks. I hope that it will stick.

@bpasero bpasero reopened this Jan 14, 2016
@bpasero
Copy link
Member

bpasero commented Jan 14, 2016

I have to revert this for now. I find it very frustrating that I type recent and the best match is Remove Line Comment and no longer File: Open Recent only because the scorer decides to give the first one a high score because R and C are beginning of words.

I still do not like that our camel case matcher kicks in for commands though. So I would expect that Focus Right matches on Focus into Right Hand Editor as well as Focus into Next Editor to the Right.

Opened #2031 for that issue.

@bpasero bpasero modified the milestones: Backlog, Jan 2016 Jan 14, 2016
@dubeg
Copy link
Author

dubeg commented Jan 14, 2016

Haa. So the score isn't also relative to the distance between characters in the string. I'll try to understand how it works.

@bpasero
Copy link
Member

bpasero commented Jan 15, 2016

@dubeg currently not, the algorithm lives here: https://github.com/Microsoft/vscode/blob/master/src/vs/base/common/scorer.ts

Even with adding something like a boost for distance, this is a tricky case because we also want to match on camel case expressions (first character of a word matching).

I wonder if the fuzzy algorithm needs to be different when matching against natural words compared to matching against a file path.

@dubeg
Copy link
Author

dubeg commented Jan 15, 2016

Hm. I checked with Atom's algo, it seems they use fuzzaldrin-plus by default now. Im guessing this is the repo. Perhaps it can help?

@bpasero
Copy link
Member

bpasero commented Jan 16, 2016

Yes we are aware of it but currently have no plans to use it.

@1st
Copy link

1st commented Jun 3, 2017

Hello. Do you have plans to implement an intelligent search like in SublimeText Command Palette?
Like I described there: #26295

@jeremychone
Copy link

jeremychone commented Aug 9, 2017

I am removing this comment, as this seems to have been fixed. The fuzzy search in the command palettes is fuzzy enough. It is in the "recent opens" ctrl R what is relatively basic, which is a minor issue.

@dann1
Copy link

dann1 commented Apr 4, 2018

Any progress on command pallete fuzzy search? I'm migrating from sublime and I miss a lot this nice feature.

@Madd0g
Copy link

Madd0g commented Sep 25, 2019

The snippets popup has a very weird fuzzy matching behavior, it matches the first word in the search even if it occurs in the middle of the string, but the second word doesn't match unless it's the beginning of words and ONLY if the first word is complete. Also matches have to be in order.

2 bottom examples don't produce matches:

image

Also don't work: urrent name, name current, urren name, name file...

@myfonj
Copy link

myfonj commented May 10, 2023

Is there any chance of reviving the idea of just permuting words from the query in the actual search? Proposal #99685 sadly received not enough attention (and #26295 is a dupe), yet it seems like it would fix most of our problems, like git stash apply query not matching “Git: apply latest stash” command.

I don’t even think there are any commands out there where the word order really matters, so naïve approach without any "original order", i.e. matching intersection of results for individual words without further prioritisation (or just leaving results of the original non-permuted query "on the top") could be quite enough.

What do you think?


I see this issue is in the backlog for some time, yet I see no clear direction or plan how to solve it here. Relaxing word order in the search filter seems like a good start, if not the solution.

@texastoland
Copy link

Now that fuzzy search works in the explorer please bring it to the command palette. Besides the points raised above it's frustrating not to be able to search extension names by initialisms like GH for GitHub.

@myfonj
Copy link

myfonj commented Oct 5, 2023

Version 1.83 ("September" (October?) 2023) brought "Similar command results in the Command Palette" what is a huge improvement. Query >git stash apply now brings relevant result ("Git: Apply Latest Stash"), just currently on the second place, after "Developer: Apply Update…":

Yet to find "File Utils: Move…" using >move file does not work; only >file move does.


BTW, linked release notes ask for feedback for this feature ("Let us know what you think!"). Is this issue right place to do so?

@TylerLeonhardt
Copy link
Member

@myfonj opened a new issue with your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality quick-open Quick-open issues (search, commands)
Projects
None yet
Development

No branches or pull requests

10 participants