================
@@ -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.
----------------
kadircet wrote:

do we know why the discrepancy exists between templated-code itself vs 
non-templated decls (i.e. how come we get the decl with comments when we're 
looking at `foo<int>()`)? I wonder if we should change something in 
sema-codecomplete to refer to "spelled" declaration in completion-result for 
non-templated cases (e.g. `bar` in `Foo<int>::bar()`) rather than working 
around it 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

Reply via email to