[PATCH] D88281: [clangd] Use Decision Forest to score code compeltions.

Adam Czachorowski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 25 06:59:49 PDT 2020


adamcz accepted this revision.
adamcz added a comment.
This revision is now accepted and ready to land.

Could you add a test that sets this flag? Perhaps we can run CodeCompletionTests.cpp twice, once with this flag, once without? Just to exercise these code paths, I think most expectations there are unordered, so it should work?



================
Comment at: clang-tools-extra/clangd/CodeComplete.cpp:1635
+    case RM::Heuristics:
+      Scores.Quality = Quality.evaluate();
+      Scores.Relevance = Relevance.evaluate();
----------------
Ideally we'd rename the evaluate() here, since SymbolQualitySignals is used for both heuristic and DecisionForest version, but evaluate is heuristic-specific. I think in pefect world this would be out of SymbolQualitySignals class (which would become just storage), but at least it should be renamed to evaluateUsingHeuristic().


================
Comment at: clang-tools-extra/clangd/CodeComplete.cpp:1655
+      // NameMatch should be a multiplier on total score to support rescoring.
+      Scores.Total = Relevance.NameMatch * Scores.ExcludingName;
+      return Scores;
----------------
Could we make the weight of Relevance.NameMatch configurable, maybe through CodeCompletionOptions or such? I'm worried it may dominate the score too much and being able to configure this would allow us to run experiments easily.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88281/new/

https://reviews.llvm.org/D88281



More information about the cfe-commits mailing list