ilya-biryukov added inline comments.

================
Comment at: clangd/CodeComplete.cpp:715
                                  unsigned NumCandidates) override {
+    TopN<ScoredSignature, ScoredSignatureGreater> Top(
+        std::numeric_limits<size_t>::max());
----------------
Maybe use `vector<ScoredSignature>`, followed by `std::sort` at the end?

Or is there any functionality that we can reuse from the priority queue?


================
Comment at: clangd/Quality.h:170
+  bool ContainsActiveParameter = false;
+  CodeCompleteConsumer::OverloadCandidate::CandidateKind Kind;
+
----------------
Maybe set some default value to avoid UB if someone forgets to set it?


================
Comment at: clangd/Quality.h:172
+
+  float evaluate() const;
+};
----------------
Maybe write a direct comparison here instead of `evaluate`?
Having floating scores makes sense for completion, where lot's of different 
signals from multiple sources are taken into account and clients have to 
rescore on the client side.
Not so much for SignatureHelp, where we have all required information to 
compare the signatures is on clangd side and clients won't need to rescore.

A comparison operator should be easier to reason about, though.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50555



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to