[clang-tools-extra] [clang] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-02-01 Thread Christian Kandeler via cfe-commits

ckandeler wrote:

> Ok, I see. (I was confused because nothing in the patch looks at the contents 
> of `Symbol::DocComment` other than 
> an `empty()` check; maybe a `bool HasDocComment` flag is sufficient?)

Right, we just need to save the information whether there was a doc comment 
before clangd put default values into the Documentation field. 

> I'll have a more detailed look when I get a chance, but one suggestion I 
> wanted to make in the meantime: for 
> changes that add new information to the index, it helps to have a sense of 
> how large of an increase to the index's 
> disk and memory footprint they entail. In the past, I've measured this with 
> the LLVM codebase's index as a "test 
> case".

Will check.


https://github.com/llvm/llvm-project/pull/67802
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-02-01 Thread Nathan Ridge via cfe-commits

HighCommander4 wrote:

Ok, I see. (I was confused because nothing in the patch looks at the contents 
of `Symbol::DocComment` other than an `empty()` check; maybe a `bool 
HasDocComment` flag is sufficient?)

I'll have a more detailed look when I get a chance, but one suggestion I wanted 
to make in the meantime: for changes that add new information to the index, it 
helps to have a sense of how large of an increase to the index's disk and 
memory footprint they entail. In the past, I've measured this with the LLVM 
codebase's index as a "test case".

The disk footprint can be measured with a simple `du -hs .cache/clangd/index` 
or similar. For the memory footprint, we have a `$/memoryUsage` protocol 
extension that provides this information (the `background_index` entry in 
particular is of interest).

Perhaps you would be interested in taking some before/after measurements along 
these lines? Feel free to choose a different codebase than LLVM as the test 
case, especially if you know of one that uses "doc comments at the definition" 
as the prevailing style.

https://github.com/llvm/llvm-project/pull/67802
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-02-01 Thread Christian Kandeler via cfe-commits

ckandeler wrote:

> Do you have another patch where you use the new `DocComment` field?  Is it 
> for showing in a hover?

Yes, it is for showing documentation in a hover. clangd already supports that; 
it's just that it currently works only if the comments are attached to the 
declaration. With this patch it works also for comments at the implementation 
site,   (which I think was the intended behavior all along). No additional 
patch is necessary.



https://github.com/llvm/llvm-project/pull/67802
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-02-01 Thread Nathan Ridge via cfe-commits

HighCommander4 wrote:

Do you have another patch where you use the new `DocComment` field? Is it for 
showing in a hover?

https://github.com/llvm/llvm-project/pull/67802
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-02-01 Thread Christian Kandeler via cfe-commits

ckandeler wrote:

ping

https://github.com/llvm/llvm-project/pull/67802
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits