Prefer matches closer to the end of the path
ClosedPublic

Authored by mwolff on Apr 4 2018, 11:33 PM.

Details

Summary

Working on one codebase, I regularly fail to quickly find some
files I'm looking for because they use generic names that are also
part of the project path. We used to match from the start and
grouped all fuzzy matches together in the OtherMatch group, thus
the sort order for the following files is the same for the filter
strings "home", "sources" or "project":

/home/user/sources/project/src/something_home.cpp
/home/user/sources/project/src/something_sources.cpp
/home/user/sources/project/src/something_project.cpp

Now, we sort the OtherMatches by how close we matched towards
the end of the path. Thus we split up the sort order for the three
paths and the corresponding three filter strings. We will now prefer
"something_home.cpp" for "home", "something_sources.cpp" for "sources"
and "something_project.cpp" for "project".

I could not see any noteworthy changes in the benchmark runtimes.

Diff Detail

Repository
R32 KDevelop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mwolff created this revision.Apr 4 2018, 11:33 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptApr 4 2018, 11:33 PM
mwolff requested review of this revision.Apr 4 2018, 11:33 PM
This revision was not accepted when it landed; it landed in state Needs Review.Apr 9 2018, 6:31 PM
This revision was automatically updated to reflect the committed changes.