This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix a regression of not showing documentation from forward declarations.
ClosedPublic

Authored by hokein on Nov 7 2019, 12:27 PM.

Details

Summary

There is a regression from https://reviews.llvm.org/D68467. Unlike class
forward declarations, function ducomentation is written in the declaration in
headers, the function definition doesn't contain any documentation, cases like:

foo.h
// this is foo.
void foo();
foo.cc

void foo() {}

we should still show documentation from the foo declaration.

Diff Detail

Event Timeline

hokein created this revision.Nov 7 2019, 12:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 7 2019, 12:27 PM
ilya-biryukov added inline comments.Nov 8 2019, 12:41 AM
clang-tools-extra/clangd/index/Merge.cpp
195

NIT: || Kind == Union
I guess it's not very common, though

clang-tools-extra/clangd/unittests/IndexTests.cpp
415

Could you add a similar test with a non-class symbol that checks the documentation is still there?

hokein updated this revision to Diff 228380.Nov 8 2019, 1:35 AM
hokein marked 2 inline comments as done.
  • include union type;
  • add testcase for non-class symbols;
ilya-biryukov accepted this revision.Nov 8 2019, 1:56 AM

LGTM

clang-tools-extra/clangd/unittests/IndexTests.cpp
416

NIT: could you also test struct and union?

This revision is now accepted and ready to land.Nov 8 2019, 1:56 AM
hokein updated this revision to Diff 228648.Nov 11 2019, 1:45 AM
hokein marked an inline comment as done.

test union and struct kinds.

This revision was automatically updated to reflect the committed changes.

Build result: pass - 59966 tests passed, 0 failed and 763 were skipped.
Log files: console-log.txt, CMakeCache.txt