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

Command palette should rank results with closer search terms higher #14727

Closed
ramya-rao-a opened this issue Oct 31, 2016 · 13 comments
Closed

Command palette should rank results with closer search terms higher #14727

ramya-rao-a opened this issue Oct 31, 2016 · 13 comments
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code quick-pick Quick-pick widget issues
Milestone

Comments

@ramya-rao-a
Copy link
Contributor

From @prashantv on October 18, 2016 19:56

See image:
image

I think a user is much more likely to want to run unit tests when they search for "Go Test" than "Generate unit tests". Is there any way to improve the search matching, or rename the option so running unit tests is preferred over generating unit tests?

Copied from original issue: microsoft/vscode-go#543

@ramya-rao-a ramya-rao-a changed the title Searching for "go test" should lead to running tests as the first option Fuzzy Search in Cmd palette should rank results with closer search terms higher Oct 31, 2016
@ramya-rao-a ramya-rao-a added the search Search widget and operation issues label Oct 31, 2016
@sandy081 sandy081 assigned jrieken and unassigned sandy081 Nov 1, 2016
@jrieken jrieken assigned bpasero and unassigned jrieken Nov 1, 2016
@jrieken
Copy link
Member

jrieken commented Nov 1, 2016

@bpasero For suggest I have implemented something similar to what @ramya-rao-a wants. It scores entries based on the search highlights, supports camel case and nearest match. We might want to consolidate, code is here: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/suggest/common/completionModel.ts#L169

@bpasero
Copy link
Member

bpasero commented Nov 1, 2016

@jrieken maybe you can move this code to filters.ts or scorer.ts so that it can be reused? I use scorer.ts today to rank based on fuzziness but we only use this for matching on file paths in quick open currently. I found the fuzziness too aggressive for the command palette.

@bpasero bpasero added feature-request Request for new features or functionality workbench and removed search Search widget and operation issues labels Nov 1, 2016
@bpasero bpasero added this to the Backlog milestone Nov 1, 2016
@bpasero
Copy link
Member

bpasero commented Nov 1, 2016

Related/duplicate: #1964

@bpasero bpasero removed their assignment Nov 3, 2016
@bpasero bpasero removed this from the Backlog milestone Nov 3, 2016
@ramya-rao-a
Copy link
Contributor Author

From @atombendor

screen shot 2016-11-14 at 13 11 12

The file cmd/gradient/main.go is scored lower even though the text I typed matches contiguously. The top matches have matched random characters in other file names which seem to have accidentally have bumped their score up, even though the matches make less sense.

@ramya-rao-a
Copy link
Contributor Author

From @andy-ms

  1. Create abc.txt, alpha-beta-cappa.txt, xyz/index.js, and xerxes-yak-zubba/index.js.
  2. Hit Ctrl-P, type "abc", and hit enter. This opens abc.txt.
  3. Hit Ctrl-P, type "xyz", and hit enter. This opens "xerxes-yak-zubba/index.js".

Also, open DefinitelyTyped and search for ace/index.d.ts. Even though this is exactly the name of a file, I get taken to cordova-plugin-email-composer/index.d.ts instead. I can't reproduce that in a small project.

@stewartadam
Copy link
Member

From #19757: this also affects users wanting to install extensions, and unfortunately does the exact opposite of what's expected: the first hit for install is actually "Disable all installed extensions" instead of "Extensions: Install"

@bpasero bpasero added this to the February 2017 milestone Feb 5, 2017
@bpasero bpasero self-assigned this Feb 5, 2017
@bpasero bpasero closed this as completed in a62cf83 Feb 6, 2017
bpasero added a commit that referenced this issue Feb 6, 2017
Fuzzy Search in Cmd palette should rank results with closer search terms higher (fixes #14727)
@bpasero bpasero added the verification-needed Verification of issue is requested label Feb 6, 2017
@bpasero
Copy link
Member

bpasero commented Feb 6, 2017

  • To verify: search for commands like "install extension" or "settings" and verify that the more relevant (shorter labeled) entries are sorted to the top

@atombender
Copy link

@bpasero Does this fix the issue with contiguous matches not scoring higher that non-contiguous ones (example)? I don't see anything in your commit that changes the scoring function.

@bpasero
Copy link
Member

bpasero commented Feb 6, 2017

@atombender no, this is limited to only command palette and the scoring function there is not tweaked beyond of what we have. I think what you ask for is in #14879

@atombender
Copy link

Ah, makes sense — although I'd expect/hope that both would be using the same underlying fuzzy-scoring code, and thus be fixed by the same fix. But I'll comment there.

@bpasero bpasero removed the verification-needed Verification of issue is requested label Feb 20, 2017
@bpasero bpasero reopened this Feb 20, 2017
@bpasero bpasero removed this from the February 2017 milestone Feb 20, 2017
@bpasero bpasero removed their assignment Feb 20, 2017
@bpasero bpasero changed the title Fuzzy Search in Cmd palette should rank results with closer search terms higher Command palette should rank results with closer search terms higher Feb 20, 2017
@stewartadam
Copy link
Member

Note - I'm still seeing this issue ("Disable all installed extensions" is ordered first) in the latest 1.10.2.

@stewartadam
Copy link
Member

Note that despite 2fbfb7b from #20553, I'm still seeing "Disable all extensions" come up first when searching with 1.22.

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 *out-of-scope Posted issue is not in scope of VS Code quick-pick Quick-pick widget issues
Projects
None yet
Development

No branches or pull requests

7 participants
@atombender @stewartadam @bpasero @jrieken @sandy081 @ramya-rao-a and others