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

Filename fuzzy match unexpected results #139014

Closed
danpalmer opened this issue Dec 13, 2021 · 4 comments
Closed

Filename fuzzy match unexpected results #139014

danpalmer opened this issue Dec 13, 2021 · 4 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@danpalmer
Copy link

danpalmer commented Dec 13, 2021

Issue Type: Bug

When using file fuzzy search I regularly get unexpected search results. Illustrative example:

Screenshot 2021-12-13 at 10 38 11

In the above image, the search was for cartenums. The top match is for a file that contains all those letters, in that order, however the next 6 results contain all those letters, in that order, closely together, in what are clearly more relevant files to any human reading the list of results.

For some context which may or may not be useful, this repository is a web app that contains both a large frontend and a large backend codebase. In the file listing, all frontend files are alphabetically before all the backend files. Anecdotally, it seems that the issue only happens this way around.

If I were to guess about the source of the issue, it would be that the search algorithm does not weight results with characters in groups higher than those that just contain the characters in order, however it may be that it does do this and that the weighting is just not at the level needed for my particular use.

I'm happy to help work on this and contribute a fix if I can have some pointers towards where to look and/or the go-ahead that a fix would be wanted. My idea would be to implement this weighting mentioned above in some form.

VS Code version: Code 1.62.3 (ccbaa2d, 2021-11-17T07:59:13.865Z)
OS version: Darwin x64 20.6.0
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz (8 x 2700)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 4, 4, 4
Memory (System) 16.00GB (0.09GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (70)
Extension Author (truncated) Version
vscode-apollo apo 1.19.9
vscode-mjml att 1.6.0
vscode-bazel Baz 0.5.0
django-html bib 1.3.0
unique-lines bib 1.0.0
markdown-mermaid bie 1.13.0
touch-bar-display bla 1.5.0
mermaid-markdown-syntax-highlighting bpr 1.2.2
pgformatter bra 1.17.0
better-toml bun 0.3.2
path-intellisense chr 2.6.0
gitignore cod 0.7.0
systemd-unit-file coo 1.0.6
vscode-mac-color-picker dae 1.0.2
vscode-eslint dba 2.2.2
vscode-dash dee 2.4.0
xml Dot 2.5.1
monitrc dru 0.0.1
gitlens eam 11.7.0
EditorConfig Edi 0.16.4
LogFileHighlighter emi 2.13.0
prettier-vscode esb 9.0.0
file-icons fil 1.0.29
copilot Git 1.7.4016
vscode-pull-request-github Git 0.32.0
vscode-graphql Gra 0.3.41
vscode-nginx-conf-hint han 0.3.0
terraform has 2.17.0
jsonnet hep 0.1.0
magit kah 0.6.24
procfile-support log 0.0.1
syntax-project-pbxproj mar 0.1.3
vscode-github-actions me- 3.0.1
rainbow-csv mec 1.10.1
xcodestrings mhc 1.0.0
dotenv mik 1.0.1
vscode-html-format moh 0.0.4
vscode-duplicate mrm 1.2.1
language-gettext mro 0.2.0
vscode-docker ms- 1.18.0
vscode-kubernetes-tools ms- 1.3.4
python ms- 2021.12.1559732655
vscode-pylance ms- 2021.12.1
jupyter ms- 2021.10.1101450599
jupyter-keymap ms- 1.0.0
jupyter-renderers ms- 1.0.4
remote-containers ms- 0.205.2
vsliveshare ms- 1.0.5196
vs-sequential-number nep 1.1.0
tuck Pet 0.1.3
erlang pgo 0.8.2
vscode-commons red 0.0.6
vscode-yaml red 1.2.2
rust rus 0.7.8
partial-diff ryu 1.4.3
jinjahtml sam 0.16.0
elm sbr 0.26.0
crates ser 0.5.10
vscode-nginx sha 0.6.0
markdown-preview-enhanced shd 0.6.1
stylelint shi 0.51.0
fish-vscode sky 0.2.1
vscode-fileutils sle 3.4.5
rewrap stk 1.15.4
vscode-mermaid-editor tom 0.11.4
change-case wma 1.0.0
jsonnet-formatter xrc 0.3.0
markdown-pdf yza 1.4.4
vscode-open-in-github ziy 1.3.6
vscode-proto3 zxh 0.5.5

(9 theme extensions excluded)

@danpalmer
Copy link
Author

Would be interested in any developer thoughts on whether this should be solved at the VSCode level, in vscode-ripgrep, or in ripgrep itself.

@bpasero
Copy link
Member

bpasero commented Dec 14, 2021

Duplicate of #25925

@bpasero bpasero marked this as a duplicate of #25925 Dec 14, 2021
@TylerLeonhardt TylerLeonhardt added the *duplicate Issue identified as a duplicate of another issue(s) label Dec 17, 2021
@TylerLeonhardt
Copy link
Member

Yeah this is because the first item in your quick pick contains all of the letters inside of the name of the file while the other items don't - they have all of the letters inside the full path. This is a dupe of #25925

@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2022
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)
Projects
None yet
Development

No branches or pull requests

5 participants
@danpalmer @roblourens @bpasero @TylerLeonhardt and others