ilya-biryukov accepted this revision.
ilya-biryukov added a comment.
This revision is now accepted and ready to land.

LGTM. (and a question on why we want to special-case the members)



================
Comment at: clangd/CodeComplete.cpp:245
+        // Methods are simply grouped by name.
+        return hash_combine('M', IndexResult->Name);
+      case index::SymbolKind::Function:
----------------
sammccall wrote:
> ilya-biryukov wrote:
> > Members never come from the index for completion, right? Maybe add an 
> > assert here instead?
> Done.
> I'd keep the actual return here as it's simple and explains the value. We 
> likely want to use it in future to augment members with signals from the 
> index.
LG, thanks!


================
Comment at: clangd/CodeComplete.cpp:263
+    if (D->isCXXClassMember())
+      return hash_combine('M', D->getDeclName().isIdentifier()
+                                   ? D->getName()
----------------
Using the normal-function scheme (fully-qualified name as grouping key) should 
also work for members and will make the code simpler.
Why do we choose to special-case the members?

This might be addressed after landing the patch, just wanted to get the 
rationale behind special-casing members.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D47957



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

Reply via email to