================ @@ -1887,7 +1887,19 @@ class CodeCompleteFlow { for (auto &Cand : C.first) { if (Cand.SemaResult && Cand.SemaResult->Kind == CodeCompletionResult::RK_Declaration) { - auto ID = clangd::getSymbolID(Cand.SemaResult->getDeclaration()); + const NamedDecl *DeclToLookup = Cand.SemaResult->getDeclaration(); + // For instantiations of members of class templates, the + // documentation will be stored at the member's original + // declaration. + // FIXME: We'd like to handle fields too but FieldDecl is missing a + // method equivalent to getInstantiatedFromMemberFunction(). ---------------- HighCommander4 wrote:
I appreciate `HeuristicResolver` is a convenient place to house code that needs to be shared between parser code and clang API clients like clangd, but I'd also like to limit its scope to operations that seem heuristic in nature in some way. This one just seems like a missing link in the AST, with nothing heuristic about it (the declaration it returns should definitely be one the input decl was instantiated from). So maybe a static method on ASTContext would make sense? Anyways, I'm going to leave addressing this FIXME to a future patch; I expect methods are the more common / important use case here. https://github.com/llvm/llvm-project/pull/153337 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits