kadircet added inline comments.
================ Comment at: clang-tools-extra/clangd/Hover.cpp:1091 + // better, which in this example would be the actual declaration of foo. + auto *DeclToUse = Decls.begin(); + while (llvm::isa<BaseUsingDecl>(*DeclToUse) && ---------------- we actually want to show the using decl in certain cases, e.g: ``` namespace ns { void foo(int); void foo(char); } using ns::foo; template <typename T> void bar() { fo^o(T{}); } ``` so rather than this, can we have some logic that looks like: ``` - If we have more than two candidates, and there's exactly one `BaseUsingDecl`, prefer that. - If we have two candidates, prefer the non-`BaseUsingDecl` one. - Prefer the first. (we hit this case when there's a single candidate or there are `multiple or no` using decls. i think multiple using decls is not possible, but at least we preserve the existing behaviour in such cases). ``` can you also export this logic to a helper function, probably called `pickDeclToUse`? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133664/new/ https://reviews.llvm.org/D133664 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits