sammccall marked an inline comment as done.
sammccall added a comment.
I'd broken the scoring scale with the last few tweaks:
- The harsh pattern-split penalty was driving too many decent matches to 0 score
- The case-insensitive change resulted in some perfect prefix matches not
getting perfect
This revision was automatically updated to reflect the committed changes.
sammccall marked an inline comment as done.
Closed by commit rL319557: [clangd] Fuzzy match scorer (authored by sammccall).
Changed prior to commit:
https://reviews.llvm.org/D40060?vs=124968&id=125159#toc
Repository:
rL
ilya-biryukov accepted this revision.
ilya-biryukov added a comment.
This revision is now accepted and ready to land.
LGTM.
Comment at: clangd/FuzzyMatch.h:53
+
+ int PatN, WordN; // Length of pattern and word.
+ char Pat[MaxPat], Word[MaxWord];
sammccall added a comment.
Thanks @ilya-biryukov, @inspirer, @klimek for the helpful comments!
I've addressed hopefully the most important and added more rigorous testing.
Sorry for the large delta, the most invasive change was of course adding the
extra dimension to the scoring table. (Which fi
sammccall updated this revision to Diff 124968.
sammccall marked 5 inline comments as done.
sammccall added a comment.
- added more VSCode tests, and made test assert matched characters. This
uncovered algorithm problems
- cache now includes "did previous character match" in the key (scoring depe
ilya-biryukov added inline comments.
Comment at: clangd/FuzzyMatch.cpp:118
+0x00, 0x00, 0x00, 0x00, // Control characters
+0xff, 0xff, 0xff, 0xff, // Punctuation
+0x55, 0x55, 0xf5, 0xff, // Numbers->Lower, more Punctuation.
I'm not sure if we care, bu
inspirer added inline comments.
Comment at: clangd/FuzzyMatch.cpp:254
+ // Penalty: matching inside a segment (and previous char wasn't matched).
+ if (WordRole[W] == Tail && P && !Matched[P - 1][W - 1])
+S -= 3;
You need a third boolean dimension in your D
sammccall updated this revision to Diff 124096.
sammccall marked 15 inline comments as done.
sammccall added a comment.
Addressing review comments and generally improving comments.
https://reviews.llvm.org/D40060
Files:
clangd/CMakeLists.txt
clangd/FuzzyMatch.cpp
clangd/FuzzyMatch.h
uni
sammccall added a comment.
Thanks for the review, and sorry for the subtlety of the code and sparse
comments.
It should be a little better now, please let me know which parts aren't clear
enough.
Comment at: clangd/FuzzyMatch.cpp:69
+: NPat(std::min(MaxPat, Pattern.size()
klimek added inline comments.
Comment at: clangd/FuzzyMatch.cpp:69
+: NPat(std::min(MaxPat, Pattern.size())), NWord(0),
+ ScoreScale(0.5f / NPat) {
+ memcpy(Pat, Pattern.data(), NPat);
Why .5?
Comment at: clangd/FuzzyMatch.cpp:88
+
sammccall updated this revision to Diff 122986.
sammccall added a comment.
Trim memory usage and add comments.
https://reviews.llvm.org/D40060
Files:
clangd/CMakeLists.txt
clangd/FuzzyMatch.cpp
clangd/FuzzyMatch.h
unittests/clangd/CMakeLists.txt
unittests/clangd/FuzzyMatchTests.cpp
I
sammccall updated this revision to Diff 122956.
sammccall added a comment.
clang-format
https://reviews.llvm.org/D40060
Files:
clangd/CMakeLists.txt
clangd/FuzzyMatch.cpp
clangd/FuzzyMatch.h
unittests/clangd/CMakeLists.txt
unittests/clangd/FuzzyMatchTests.cpp
Index: unittests/clangd/
sammccall created this revision.
Herald added a subscriber: mgorny.
This will be used for rescoring code completion results based on partial
identifiers.
Short-term use:
- we want to limit the number of code completion results returned to improve
performance of global completion. The scorer will
13 matches
Mail list logo