Penalize matches in the shared project prefix path

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

Description

Penalize matches in the shared project prefix path

Summary:
This is a refinement of the previous patch, which isn't perfect yet:
Assume you have a project at /A/B/C. Now, you have
these two files in there:

/A/B/C/D/file
/A/B/C/C/E/file

Note also how quickopen trims the shared prefix path when it displays
the results:

D/file
C/E/file

When you search for C/file, both files used to get the same quality,
even though the former one matches only in the shared prefix path
of the project.

This patch adds a penalty when the match happens in the shared
prefix. Thus, when you search for C/file you'd now get the second
path preferred. This is imo much more desirable.

The benchmark timings are still pretty much the same.

Subscribers: kdevelop-devel

Differential Revision: https://phabricator.kde.org/D11940

Details

Committed
mwolffApr 9 2018, 6:21 PM
Differential Revision
D11940: Penalize matches in the shared project prefix path
Parents
R32:0d38ff7cdd48: Prefer matches closer to the end of the path
Branches
Unknown
Tags
Unknown