natecraddock / zf

a commandline fuzzy finder and zig module designed for filtering filepaths
MIT License
469 stars 17 forks source link

Improve path matching ranking #26

Closed natecraddock closed 1 year ago

natecraddock commented 1 year ago

Something I noticed

> mod/baz.rb
./app/models/foo-bar-baz.rb
./app/models/foo/bar-baz.rb
./app/models/foo/bar/baz.rb

In this case I think we should expect mod/baz.rb to rank ./app/models/foo/bar/baz.rb the hightest because baz.rb has the greatest path segment coverage on that string.

Pistos commented 1 year ago

This is a good improvement, but when I try with version 734af10b315a87fa9ebd74c3e3417d8208b66566 , given:

app/models/abilities/attributes/customers.rb
app/models/user.rb

when I search for ap/mod/user.rb, the customers.rb is ranked higher. Perhaps this is because the a of abilities sorts alphabetically before the u of user.rb at the same level (siblings under app/models/)

natecraddock commented 1 year ago

@Pistos I'm not seeing this on my end

image

Pistos commented 1 year ago

My bad. It was my editor doing the sorting. Sorry for the noise. :sweat_smile:

natecraddock commented 1 year ago

No worries! Thanks for actively reporting things :)