kadircet added a comment.

Could you also add a lit test for the case you mentioned in the github issue?
You can find pointers in clang-tools-extra/clangd/test/diagnostics.test and 
clang-tools-extra/clangd/test/fixits-codeaction.test



================
Comment at: clang-tools-extra/clangd/Protocol.h:654
   bool operator()(const Diagnostic &LHS, const Diagnostic &RHS) const {
-    return std::tie(LHS.range, LHS.message) < std::tie(RHS.range, RHS.message);
+    return std::tie(LHS.code, LHS.range, LHS.message) <
+           std::tie(RHS.code, RHS.range, RHS.message);
----------------
could you rather put `code` after range and message so that we somewhat 
preserve the ordering. I am not sure if it is used anywhere but looks like we 
are using an ordered container(std::map) to store these.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63316



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

Reply via email to