Skip to content

Commit d77969f

Browse files
committed
ignore empty freestanding paragraphs
1 parent cfbda5a commit d77969f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

clang-tools-extra/clangd/SymbolDocumentation.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ class SymbolDocCommentVisitor
127127
llvm::raw_string_ostream &Out) const;
128128

129129
void visitParagraphComment(const comments::ParagraphComment *P) {
130-
FreeParagraphs[CommentPartIndex] = P;
131-
CommentPartIndex++;
130+
if (!P->isWhitespace()) {
131+
FreeParagraphs[CommentPartIndex] = P;
132+
CommentPartIndex++;
133+
}
132134
}
133135

134136
void visitParamCommandComment(const comments::ParamCommandComment *P) {

clang-tools-extra/clangd/unittests/SymbolDocumentationTests.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,14 @@ Another paragraph)",
292292
this is not treated as brief
293293
294294
Another paragraph)"},
295+
{R"(
296+
@brief Some brief
297+
)",
298+
"", "", ""},
299+
{R"(
300+
Some brief
301+
)",
302+
"", "", ""},
295303
};
296304
for (const auto &C : Cases) {
297305
markup::Document Doc;

0 commit comments

Comments
 (0)