How does KDevelop's quick open match names??
Milian Wolff
mail at milianw.de
Tue Jul 24 21:36:15 BST 2018
On Freitag, 20. Juli 2018 20:22:23 CEST Matthew Woehlke wrote:
> Okay, this has been bothering me for some time. Can someone explain the
> logic behind how Quick Open decides what it thinks you want to open? In
> particular, can someone explain why it "prefers" more distant matches,
> at least when typing file names?
>
> See attached example. I've typed "options.p", which Quick Open thinks is
> a better match for "options_for_QT.cpp", which is a "split" match (if I
> divide the input string into three parts, each part matches, in order)
> than for "make_options.py", an exact substring match.
>
> I notice this almost constantly; given an input like "abc", Quick Open
> almost always "prefers" matches like "qabdcx" (that only match when
> additional text is inserted e.g. between 'b' and 'c') over a match like
> "abc.x" that not only contains, but *starts with*, the exact string
> "abc". Why is this?
I've worked on this "recently". Fixing your situation should certainly be
possible. I think it behaves as-is simply because we developers weren't
bothered by this specific quirk yet. Personally, I hacked the quickopen
matching algorithm a couple of months ago only because the path/file naming
convention in a new project I was working on triggered some corner cases I
didn't see before. I think your case is another such case.
Note that the quickopen code base is very well unit tested. Meaning: try to
look at the unit tests, extend the code to add a (failing) test for your
situation. Then either also start to change the code to fix the test, or at
least send in this new unit test code to quickstart the work for others (me?).
Cheers
--
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop/attachments/20180724/6a00b636/attachment.sig>
More information about the KDevelop
mailing list