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

History: Fuzzy-filter: prioritize word-boundry matches #100590

Closed
JacksonKearl opened this issue Jun 19, 2020 · 8 comments
Closed

History: Fuzzy-filter: prioritize word-boundry matches #100590

JacksonKearl opened this issue Jun 19, 2020 · 8 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality info-needed Issue requires more information from poster quick-pick Quick-pick widget issues

Comments

@JacksonKearl
Copy link
Contributor

JacksonKearl commented Jun 19, 2020

Suggestion: fuzzy filtering can prioritize matches at word starts, as IMO it's more likely for someone to be typing from a wordstart than a random substring.

For instance, here I'm typing the first part of actions, but other things come first.
in this case I'd expect either apply-changes or actions to be at the top, followed by the other.
image

This is what I do in the triage extension, https://github.com/microsoft/vscode-github-triage-extension/blob/eb3bd12d537a152aba60783aeee3e527fd8bfabf/src/common/fuzzyMatch.ts#L17-L29

@JacksonKearl JacksonKearl assigned joaomoreno and jrieken and unassigned joaomoreno Jun 19, 2020
@JacksonKearl JacksonKearl changed the title Fuzzy-filter: prioritize "critical index" matches? Fuzzy-filter: prioritize word-boundry matches? Jun 19, 2020
@jrieken
Copy link
Member

jrieken commented Jun 22, 2020

Yeah, fuzzyScore does that. It boosts matches after separators and makes sequences of contiguous matches score higher. So, in theory it should work... However, I believe this part of quick pick doesn't use fuzzyScore - ping @bpasero

@bpasero bpasero added the quick-pick Quick-pick widget issues label Jun 22, 2020
@bpasero
Copy link
Member

bpasero commented Jun 22, 2020

I think you are seeing history matches where we use a slightly different matcher strategy, in general history matches always come first using a less fuzzy scorer and then use a fuzzy scorer that does what you ask, see:

// Start of word bonus
if (targetIndex === 0) {
score += 8;

I will add this to #27317

@bpasero bpasero added the feature-request Request for new features or functionality label Jun 22, 2020
@bpasero bpasero changed the title Fuzzy-filter: prioritize word-boundry matches? History: Fuzzy-filter: prioritize word-boundry matches? Jun 22, 2020
@bpasero bpasero changed the title History: Fuzzy-filter: prioritize word-boundry matches? History: Fuzzy-filter: prioritize word-boundry matches Jun 22, 2020
@JacksonKearl
Copy link
Contributor Author

Ah okay, so in this case I'm viewing the recently opened folders, filtered by those that have any match with the query, then sorted alphabetically?

Would it be possible to optionally remove last alphabetic sort step, so that I view the results in fuzzyScore order always? That or recency of access, in the above case I'm working in vscode-github-triage-actions pretty much every day, and the others quite rarely, but traige-actions is still always at the bottom.

@bpasero
Copy link
Member

bpasero commented Jun 25, 2020

@JacksonKearl I think what you are suggesting is a setting to always sort both history and file results fuzzy? This would mean that history results no longer get a boost over other results? Basically you can do this today already via "search.quickOpen.includeHistory": false

@bpasero bpasero added the info-needed Issue requires more information from poster label Jun 25, 2020
@JacksonKearl
Copy link
Contributor Author

JacksonKearl commented Jun 25, 2020

This is with regards to recent workspaces (workbench.action.openRecent), which seems unaffected by that history setting (they're all history).

It initially looks like:
image

Which seems to be sorted by recent use (good). Note vscode-github-triage-actions is pretty high up.

I then type ac and I get this:
image

Which is sorted alphabetically (bad). I would expect the filtered list to be sorted either by fuzzy match score or by recency of use, alphabetics doesn't seem very useful. Note that vscode-github-triage-actions is now at the bottom, even though none of the others were opened more recently than it.

@bpasero
Copy link
Member

bpasero commented Jun 26, 2020

@JacksonKearl that is just a normal picker, it does not use fuzzy scoring.

/duplicate #34088

@bpasero bpasero closed this as completed Jun 26, 2020
@JacksonKearl
Copy link
Contributor Author

Sad.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 10, 2020
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 info-needed Issue requires more information from poster quick-pick Quick-pick widget issues
Projects
None yet
Development

No branches or pull requests

5 participants
@joaomoreno @bpasero @jrieken @JacksonKearl and others