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

Broken fuzzy search algorithm in picker #34914

Closed
fabiospampinato opened this issue Sep 24, 2017 · 9 comments
Closed

Broken fuzzy search algorithm in picker #34914

fabiospampinato opened this issue Sep 24, 2017 · 9 comments
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality quick-pick Quick-pick widget issues
Milestone

Comments

@fabiospampinato
Copy link
Contributor

The fuzzy search algorithm can be improved to solve all problems listed in #27317, but IMHO it's completely broken and it should be rewritten from scratch. Let me show you some of the errors I've found:

Doesn't work with leading spaces

This is the expected behavior:

ok_todop

This is what happens if the strings have some leading spaces (useful for extensions like Projects+ for showing a tree-like structure):

broken_todop

Not really "fuzzy"

As I understand it, the term "fuzzy" in "fuzzy search" basically means that the characters provided in the search query can have 0 or more other arbitrary characters between them in the matching string. The current algorithm looks like regular search instead:

broken_fuzzy

Overly strict about string position

For some reasons there are strings that match against some queries, but don't mach against less specific versions of those queries. I mean, a more specific query should provide the same or less results, not more, right?

broken_start

@vscodebot vscodebot bot added the search Search widget and operation issues label Sep 24, 2017
@roblourens roblourens assigned jrieken and unassigned roblourens Sep 24, 2017
@roblourens roblourens removed the search Search widget and operation issues label Sep 24, 2017
@jrieken jrieken assigned bpasero and unassigned jrieken Sep 25, 2017
@bpasero bpasero added this to the Backlog milestone Sep 25, 2017
@bpasero bpasero added the quick-pick Quick-pick widget issues label Sep 25, 2017
@bpasero
Copy link
Member

bpasero commented Sep 29, 2017

@fabiospampinato some of this can be explained by the fact that fuzzy search is NOT enabled for the normal picker (see #34088). Currently we have it only enabled for the file search because it still needs to be tweaked. I need to check for the leading whitespace issue but it may be related to the same cause.

@bpasero bpasero changed the title Broken fuzzy search algorithm Broken fuzzy search algorithm in picker Sep 29, 2017
@bpasero
Copy link
Member

bpasero commented Sep 30, 2017

@fabiospampinato trying to reproduce the issue with leading white space but I cannot:

panel-red

Is there any way I could try it on the code that you used for your animation to reproduce the same?

@fabiospampinato
Copy link
Contributor Author

@bpasero Try prefixing those strings with exactly 8 spaces. For whatever reason the bug doesn't manifest itself with just 4 spaces in my system.

If it doesn't work, install Projects+, run Projects: Edit Configuration and paste this:

{
  "groups": [
    {
      "name": "open",
      "groups": [
        {
          "name": "vscode",
          "projects": [
            {
              "name": "vscode-projects-plus-todo-plus",
              "path": "/"
            },
            {
              "name": "vscode-todo-plus",
              "path": "/"
            }
          ]
        }
      ]
    }
  ]
}

Then run Project: Open and try it again.

It would be weird if it still doesn't work.

@bpasero
Copy link
Member

bpasero commented Sep 30, 2017

@fabiospampinato thanks, I can reproduce now.

@bpasero bpasero added the feature-request Request for new features or functionality label Nov 6, 2017
@bpasero bpasero removed their assignment Nov 6, 2017
@fabiospampinato
Copy link
Contributor Author

@bpasero Here there's another bug, in the following gif I hit down 2 times and then up 2 times and nothing gets selected instead of selecting the last item:

2017-11-09 16_54_49

When will this bugs be resolved?

@bpasero
Copy link
Member

bpasero commented Nov 10, 2017

@fabiospampinato I think that one is fixed already in our latest insider build, can you check

@fabiospampinato
Copy link
Contributor Author

@bpasero It's fixed. Thank you.

@bpasero
Copy link
Member

bpasero commented Nov 17, 2017

/duplicate #34088

@vscodebot vscodebot bot added the *duplicate Issue identified as a duplicate of another issue(s) label Nov 17, 2017
@vscodebot
Copy link

vscodebot bot commented Nov 17, 2017

This issue has been closed because it is already tracked by another issue. See also our GitHub issues to search for existing issues and our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Nov 17, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality quick-pick Quick-pick widget issues
Projects
None yet
Development

No branches or pull requests

4 participants