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

Extension API: QuickPick fuzzy search not finding results #103354

Open
svsool opened this issue Jul 26, 2020 · 8 comments
Open

Extension API: QuickPick fuzzy search not finding results #103354

svsool opened this issue Jul 26, 2020 · 8 comments
Assignees
Labels
feature-request Request for new features or functionality quick-pick Quick-pick widget issues
Milestone

Comments

@svsool
Copy link

svsool commented Jul 26, 2020

Hi,

I use QuickPick component for opening daily notes in my extension.

Example:
image

When I type -2d or -2 d I expect -2 days | Friday, July 24, 2020 Exists (see screenshot above) to appear in the results, but I see this instead:

image

Sorting is also wrong as -25 days item comes last in the results. In the order I provide it to QuickPick -25 comes before -172, -235, -263. Is it configurable?

Another example:

image

When I type +m I expect all Mondays with leading +n days to appear from previous screenshot, but I see this instead:

image

What could be the problem with it or am I missing something?

Thanks!

@bpasero
Copy link
Member

bpasero commented Aug 12, 2020

/duplicate #27317

@bpasero bpasero reopened this Aug 13, 2020
@bpasero
Copy link
Member

bpasero commented Aug 13, 2020

@svsool Maybe I closed too soon, can you give a minimal code snippet for me to run an extension with this picker? Thanks

@bpasero bpasero added info-needed Issue requires more information from poster and removed *duplicate Issue identified as a duplicate of another issue(s) labels Aug 13, 2020
@svsool
Copy link
Author

svsool commented Aug 13, 2020

Sure thing.

For repro purpose I modified "Open daily note" command to not rely on disk and render all results from past / next 2 years statically.

  1. Please clone this repo https://github.com/svsool/vscode-memo and checkout quickpick-bug branch
  2. Run yarn && code .
  3. Then F5 to run extension host
  4. Open any workspace
  5. Execute "Open daily note" command from the command palette
  6. Input "+m" vs "Monday" to see the difference in results, also "-m" finds nothing for instance where all Mondays with leading "-n days" expected

@bpasero
Copy link
Member

bpasero commented Aug 14, 2020

Thanks, I can reproduce. I wonder if this possibly could be a duplicate of #34088

However, I am not entirely sure why for example I can type "fr august" and it returns results:

image

Since the quick pick implementation was done by @chrmarti I would like to confirm with him and then we can close as duplicate. Maybe there is a rule in place that treats non-word characters such as - different.

@bpasero bpasero assigned chrmarti and unassigned bpasero Aug 14, 2020
@bpasero bpasero added quick-pick Quick-pick widget issues and removed info-needed Issue requires more information from poster labels Aug 14, 2020
@bpasero bpasero changed the title QuickPick fuzzy search Extension API: QuickPick fuzzy search not finding results Aug 14, 2020
@svsool
Copy link
Author

svsool commented Aug 14, 2020

Thanks, I can reproduce. I wonder if this possibly could be a duplicate of #34088

However, I am not entirely sure why for example I can type "fr august" and it returns results:

image

Since the quick pick implementation was done by @chrmarti I would like to confirm with him and then we can close as duplicate. Maybe there is a rule in place that treats non-word characters such as - different.

What is also a bit weird is that there should be more than two Fridays in August, but it shows only two of them. I can see all Fridays when input is empty just by scrolling through +/- days around today, but not when the input has "fr august". I'd expect it to show all Fridays from every August, there should be around 4 August months to choose from because in this example range spans over +/- 2 years from now.

For instance, these two Fridays (I believe) should be shown when "fr august" typed as well:

image

image

@chrmarti
Copy link
Collaborator

Using matchesFuzzyCodiconAware() from codicon.ts for matching and compareAnything() from comparers.ts for sorting. @bpasero Should I switch to something else?

@bpasero
Copy link
Member

bpasero commented Aug 17, 2020

@chrmarti you can change to fuzzyScorer.scoreFuzzy or fuzzyScorer.scoreFuzzy2. The former is used by quick open for files and the latter for quick open for symbols (and intellisense).

There is a risk of breaking muscle memory though. Related: #34088

@chrmarti chrmarti added this to the Backlog milestone Aug 18, 2020
@chrmarti chrmarti added the feature-request Request for new features or functionality label Aug 18, 2020
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-pick Quick-pick widget issues
Projects
None yet
Development

No branches or pull requests

5 participants
@bpasero @svsool @TylerLeonhardt @chrmarti and others