diff options
author | Sam McCall <sam.mccall@gmail.com> | 2018-05-15 17:43:27 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2018-05-15 17:43:27 +0000 |
commit | c5707b6c36a055ce5651cf8b19e7595d2f0e0826 (patch) | |
tree | 08a7187076be6005ca6165d3c6af337cb74fd3f8 /llvm/unittests/Support/CommandLineTest.cpp | |
parent | 603a43fcd526a59f4e68291bb39e6cb51b1e8bc1 (diff) | |
download | llvm-c5707b6c36a055ce5651cf8b19e7595d2f0e0826.zip llvm-c5707b6c36a055ce5651cf8b19e7595d2f0e0826.tar.gz llvm-c5707b6c36a055ce5651cf8b19e7595d2f0e0826.tar.bz2 |
[clangd] Extract scoring/ranking logic, and shave yaks.
Summary:
Code completion scoring was embedded in CodeComplete.cpp, which is bad:
- awkward to test. The mechanisms (extracting info from index/sema) can be
unit-tested well, the policy (scoring) should be quantitatively measured.
Neither was easily possible, and debugging was hard.
The intermediate signal struct makes this easier.
- hard to reuse. This is a bug in workspaceSymbols: it just presents the
results in the index order, which is not sorted in practice, it needs to rank
them!
Also, index implementations care about scoring (both query-dependent and
independent) in order to truncate result lists appropriately.
The main yak shaved here is the build() function that had 3 variants across
unit tests is unified in TestTU.h (rather than adding a 4th variant).
Reviewers: ilya-biryukov
Subscribers: klimek, mgorny, ioeric, MaskRay, jkorous, mgrang, cfe-commits
Differential Revision: https://reviews.llvm.org/D46524
llvm-svn: 332378
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
0 files changed, 0 insertions, 0 deletions