The results returned back from the QuickOpen now are much better with the regex filter, but they aren't sorted the best.
This can lead to confusing results where you've typed the exact name of a file and its still not the first result.

One idea was to bring over the VSCode QuickOpen scoring logic which can be found here : https://github.com/Microsoft/vscode/blob/master/src/vs/base/parts/quickopen/common/quickOpenScorer.ts
This would give us a scoring system that we could then sort the results based on, and it could live in its own repo, like the Snippets provider code.
Apart from that, we could attempt to write our own, or check an equivalent bit of logic from Atom.
I'm open to attempting to move the VSCode stuff over into a module, but would appreciate some heads up on how I should do the move. The most awkward bit looks to be the comparers, which links into a bunch more stuff in that file and so on. Should I be grabbing everything and just copying it over? The snippets code is only two files, so wasn't too sure.
I'm open to attempting to move the VSCode stuff over into a module, but would appreciate some heads up on how I should do the move.
Cool! I think they have the best implementation - it would be great to have that in a reusable module.
We could bring over the comparers into that module - we could remove these dependencies:
import * as strings from 'vs/base/common/strings';
import * as paths from 'vs/base/common/paths';
(they look really minimal - just helpers for startsWith and endsWith, and the path separator - things that we could grab independently).
There's also potentially some extraneous methods that wouldn't be needed - the main thing is the compareAnything + its dependency tree.
Should I be grabbing everything and just copying it over? The snippets code is only two files, so wasn't too sure.
It does look like it'll be a couple more files than the snippets, though. LMK if you need any help. Copying everything over to start is reasonable, and then we can prune it once it's building / running 馃憤
The nice part is the root method for scoring:
export function score(target: string, query: string, queryLower: string, fuzzy: boolean): Score {
should plug right in!
Thanks for looking at this, @CrossR !
This is implemented now as the default fuzzy finder function.
It can be set manually by setting "editor.quickOpen.filterStrategy" to "vscode", but since its the default you shouldn't need that. The "fuse" and "regex" options are still around, but do not use this scorer.
Most helpful comment
This is implemented now as the default fuzzy finder function.
It can be set manually by setting
"editor.quickOpen.filterStrategy"to"vscode", but since its the default you shouldn't need that. The"fuse"and"regex"options are still around, but do not use this scorer.