Vscode: Add fuzzy search to commands in palette

Created on 12 Jan 2016  路  13Comments  路  Source: microsoft/vscode

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.

feature-request quick-pick

Most helpful comment


This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

All 13 comments

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.

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

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

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 https://github.com/Microsoft/vscode/issues/2031 for that issue.

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

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

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?

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

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

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.

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

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


This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Was this page helpful?
0 / 5 - 0 ratings