HomePhabricator

[clangd] Tune the fuzzy-matching algorithm

Description

[clangd] Tune the fuzzy-matching algorithm

Summary:
To reduce the gap between prefix and initialism matches.

The motivation is producing better scoring in one particular example,
but the change does not seem to cause large regressions in other cases.

The examples is matching 'up' against 'unique_ptr' and 'upper_bound'.
Before the change, we had:

  • "[u]nique_[p]tr" with a score of 0.3,
  • "[up]per_bound" with a score of 1.0.

A 3x difference meant that symbol quality signals were almost always ignored
and 'upper_bound' was always ranked higher.

However, intuitively, the match scores should be very close for the two.

After the change we have the following scores:

  • "[u]nique_[p]tr" with a score of 0.75,
  • "[up]per_bound" with a score of 1.0.

Reviewers: ioeric

Reviewed By: ioeric

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D59300

Details

Committed
ibiryukovMar 15 2019, 7:00 AM
Reviewer
ioeric
Differential Revision
D59300: [clangd] Tune the fuzzy-matching algorithm
Parents
rL356260: [CodeGenPrepare] avoid crashing from replacing a phi twice
Branches
Unknown
Tags
Unknown