[clang] [clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)
Nathan Ridge via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 11 22:15:49 PDT 2024
================
@@ -1477,6 +1477,26 @@ TEST_F(SymbolCollectorTest, Documentation) {
forCodeCompletion(false))));
}
+TEST_F(SymbolCollectorTest, DocumentationInMain) {
----------------
HighCommander4 wrote:
I'm thinking of it less as "specification", and more as a way for us to be alerted if the behaviour changes. If something has a side effect of changing this behaviour, I would find that useful to know about, even if the conclusion is that the change in behaviour is fine.
Your comment made me realize we actually want two sub-cases here: one where the declaration comes first in the translation unit, and one where the definition comes first (this latter only being possible for free functions or classes, not member functions). My understanding is that the current code will choose the comment at the earlier site in each case.
https://github.com/llvm/llvm-project/pull/67802
More information about the cfe-commits
mailing list