Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clang-tools-extra/clang-doc/JSONGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ static Object serializeComment(const CommentInfo &I, Object &Description) {
auto TextCommentsArray = extractTextComments(CARef.front().getAsObject());
if (I.Name == "brief")
insertComment(Description, TextCommentsArray, "BriefComments");
else if (I.Name == "return")
insertComment(Description, TextCommentsArray, "ReturnComments");
return Obj;
}

Expand Down
8 changes: 8 additions & 0 deletions clang-tools-extra/clang-doc/assets/comment-template.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
</div>
{{/ParamComments}}
{{/HasParamComments}}
{{#HasReturnComments}}
<h3>Returns</h3>
{{#ReturnComments}}
{{#.}}
<p>{{TextComment}}</p>
{{/.}}
{{/ReturnComments}}
{{/HasReturnComments}}
{{#BlockCommandComment}}
<div class="block-command-comment__command">
<div class="block-command-command">
Expand Down
23 changes: 23 additions & 0 deletions clang-tools-extra/test/clang-doc/basic-project.mustache.test
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ HTML-SHAPE: </div>
HTML-SHAPE: <div>
HTML-SHAPE: <p></p>
HTML-SHAPE: </div>
HTML-SHAPE: <h3>Returns</h3>
HTML-SHAPE: <p> double The area of the shape.</p>
HTML-SHAPE: </div>
HTML-SHAPE: </div>
HTML-SHAPE: </div>
Expand All @@ -113,6 +115,8 @@ HTML-SHAPE: </div>
HTML-SHAPE: <div>
HTML-SHAPE: <p></p>
HTML-SHAPE: </div>
HTML-SHAPE: <h3>Returns</h3>
HTML-SHAPE: <p> double The perimeter of the shape.</p>
HTML-SHAPE: </div>
HTML-SHAPE: </div>
HTML-SHAPE: </div>
Expand Down Expand Up @@ -277,6 +281,8 @@ HTML-CALC: <div>
HTML-CALC: <p></p>
HTML-CALC: </div>
HTML-CALC: </div>
HTML-CALC: <h3>Returns</h3>
HTML-CALC: <p> int The sum of a and b.</p>
HTML-CALC: </div>
HTML-CALC: </div>
HTML-CALC: </div>
Expand All @@ -297,6 +303,8 @@ HTML-CALC: </div>
HTML-CALC: <div>
HTML-CALC: <p></p>
HTML-CALC: </div>
HTML-CALC: <h3>Returns</h3>
HTML-CALC: <p> int The result of a - b.</p>
HTML-CALC: </div>
HTML-CALC: </div>
HTML-CALC: </div>
Expand Down Expand Up @@ -334,6 +342,8 @@ HTML-CALC: <div>
HTML-CALC: <p></p>
HTML-CALC: </div>
HTML-CALC: </div>
HTML-CALC: <h3>Returns</h3>
HTML-CALC: <p> int The product of a and b.</p>
HTML-CALC: </div>
HTML-CALC: </div>
HTML-CALC: </div>
Expand Down Expand Up @@ -371,6 +381,9 @@ HTML-CALC: <div>
HTML-CALC: <p></p>
HTML-CALC: </div>
HTML-CALC: </div>
HTML-CALC: <h3>Returns</h3>
HTML-CALC: <p> double The result of a / b.</p>
HTML-CALC: <p></p>
HTML-CALC: </div>
HTML-CALC: </div>
HTML-CALC: </div>
Expand Down Expand Up @@ -408,6 +421,8 @@ HTML-CALC: <div>
HTML-CALC: <p></p>
HTML-CALC: </div>
HTML-CALC: </div>
HTML-CALC: <h3>Returns</h3>
HTML-CALC: <p> The result of a % b.</p>
HTML-CALC: </div>
HTML-CALC: </div>
HTML-CALC: </div>
Expand Down Expand Up @@ -541,6 +556,8 @@ HTML-RECTANGLE: </div>
HTML-RECTANGLE: <div>
HTML-RECTANGLE: <p></p>
HTML-RECTANGLE: </div>
HTML-RECTANGLE: <h3>Returns</h3>
HTML-RECTANGLE: <p> double The area of the rectangle.</p>
HTML-RECTANGLE: </div>
HTML-RECTANGLE: </div>
HTML-RECTANGLE: </div>
Expand All @@ -561,6 +578,8 @@ HTML-RECTANGLE: </div>
HTML-RECTANGLE: <div>
HTML-RECTANGLE: <p></p>
HTML-RECTANGLE: </div>
HTML-RECTANGLE: <h3>Returns</h3>
HTML-RECTANGLE: <p> double The perimeter of the rectangle.</p>
HTML-RECTANGLE: </div>
HTML-RECTANGLE: </div>
HTML-RECTANGLE: </div>
Expand Down Expand Up @@ -686,6 +705,8 @@ HTML-CIRCLE: </div>
HTML-CIRCLE: <div>
HTML-CIRCLE: <p></p>
HTML-CIRCLE: </div>
HTML-CIRCLE: <h3>Returns</h3>
HTML-CIRCLE: <p> double The area of the circle.</p>
HTML-CIRCLE: </div>
HTML-CIRCLE: </div>
HTML-CIRCLE: </div>
Expand All @@ -706,6 +727,8 @@ HTML-CIRCLE: </div>
HTML-CIRCLE: <div>
HTML-CIRCLE: <p></p>
HTML-CIRCLE: </div>
HTML-CIRCLE: <h3>Returns</h3>
HTML-CIRCLE: <p> double The perimeter of the circle.</p>
HTML-CIRCLE: </div>
HTML-CIRCLE: </div>
HTML-CIRCLE: </div>
Expand Down
Loading