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

Enable fuzzy matching for picker #34088

Open
ramya-rao-a opened this issue Sep 10, 2017 · 13 comments
Open

Enable fuzzy matching for picker #34088

ramya-rao-a opened this issue Sep 10, 2017 · 13 comments
Assignees
Labels
api feature-request Request for new features or functionality quick-pick Quick-pick widget issues
Milestone

Comments

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Sep 10, 2017

Have a quick pick control with these values ["hello", "hello_there"]

Type ht or hello_ -> hello_there will show up
Type he_ -> no results

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities quick-pick Quick-pick widget issues labels Sep 11, 2017
@bpasero bpasero added this to the Backlog milestone Sep 11, 2017
@bpasero bpasero changed the title Fuzzy search in Quick pick control doesn't work with _ Enable fuzzy matching for picker Sep 12, 2017
@bpasero bpasero added feature-request Request for new features or functionality and removed bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities labels Sep 12, 2017
@bpasero
Copy link
Member

bpasero commented Sep 12, 2017

@ramya-rao-a I looked into this and this is because true fuzzy matching is not enabled for the picker. The difference to our current matching strategy is that true fuzzy matching allows to return a result as matching if the search characters are part of the target word even if there are other characters in between. The fact that ht matches is due to our camel case matching.

I think it would be tough to enable this for all pickers so we might need an option here for the extension to enable this.

@bpasero bpasero added the api label Sep 12, 2017
@bpasero bpasero removed this from the Backlog milestone Sep 12, 2017
@bpasero bpasero added this to the Backlog milestone Sep 12, 2017
@szyhf
Copy link

szyhf commented Sep 12, 2017

Nice ~

@fabiospampinato
Copy link
Contributor

@bpasero why are there even different algorithms being used? This is surprising to me.

We surely can't expect users to think "is fuzzy search enabled in this picker? maybe I should search for bar instead of br here". If there was an option for extensions to enable fuzzy search this kind of reasoning would become even messier.

I think it would be tough to enable this for all pickers

Why is that?

@bpasero
Copy link
Member

bpasero commented Sep 29, 2017

@fabiospampinato the fuzzy scoring we do currently was tweaked for file names only, it is not a general purpose fuzzy scorer. That is why it was not enabled for all contexts. I think before we can do that we should revisit our current implementation and think about dropping in a better one that is just generally matching better.

@fabiospampinato
Copy link
Contributor

@bpasero I think the "filtering" and "ranking" logic should be considered separately. It would be pretty easy to enable fuzzy filtering everywhere (ranking results naively on the order of appearance) while still having a custom ranking logic for file paths.

@Eskibear
Copy link
Member

@bpasero I cannot figure out why here 1 matchs but 2 not ?

image

More details here: microsoft/vscode-spring-initializr#26 (comment)

Version 1.19.1
Commit 0759f77bb8d86658bc935a10a64f6182c5a1eeba
Date 2017-12-19T09:46:02.926Z
Shell 1.7.9
Renderer 58.0.3029.110
Node 7.9.0
Architecture ia32

@bpasero
Copy link
Member

bpasero commented Jan 22, 2018

@Eskibear we have a heuristic when we should try to match on camel casing (by jumping over words), but this heuristic is limited to entries < 60 characters length for performance reasons. The second label simply seems too long for that kind of matching to apply.

@smbkr
Copy link
Contributor

smbkr commented Jan 6, 2020

I think it would be tough to enable this for all pickers so we might need an option here for the extension to enable this.

@bpasero it's been more than a couple of years since this was looked at. Has anything changed in the current state of VSCode that would make it easier to implement fuzzy search everywhere? This limitation has come up a number of times in extensions as can be seen from the mentions.

@xh3b4sd
Copy link

xh3b4sd commented Oct 1, 2020

I created alefragnani/vscode-project-manager#428 and was directed to here. It looks like there are quite a couple of supporting arguments to improve the current state of searching. Though what I am not sure about is why the behaviour in search is different when searching for different things.

@gpeal
Copy link

gpeal commented Dec 4, 2022

I recently switched from the IntelliJ world to VSCode and the fuzzy match algorithm of VSCode is slowly driving me insane. In addition to the cases here, one thing that IntelliJ gets really right is case sensitive matching of partial words and priority for local symbols.

Check out this example. I am trying to match externalReport which is defined on the line immediately above. ext correctly matches. Typing R should increase the weight of the already-top result but instead, it drops off the list entirely.

The result of this is that I frequently wind up with random variables and imports as a result of the correct result disappearing after I type more letters that should only increase its weight.

CleanShot 2022-12-02 at 16 52 34@2x (1)

CleanShot 2022-12-02 at 16 52 30@2x (1)

You can see a similar result play out here:
CleanShot 2022-11-30 at 13 44 37@2x (1)
vs WebStorm:
CleanShot 2022-11-30 at 13 45 20@2x (1)

@gpeal
Copy link

gpeal commented Jun 1, 2023

Here's another example. I think it is reasonable to expect InteractiveTableComponent to be matched above footprintTaggingBuilderAddRuleComponent, right?

CleanShot 2023-05-31 at 17 23 34@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api feature-request Request for new features or functionality quick-pick Quick-pick widget issues
Projects
None yet
Development

No branches or pull requests

10 participants