Skip to content

Commit 74d6d04

Browse files
Don't add duplicates of JSDoc comments.
1 parent 1450908 commit 74d6d04

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/services/jsDoc.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,13 @@ namespace ts.JsDoc {
9393
forEachUnique(declarations, declaration => {
9494
for (const { comment } of getCommentHavingNodes(declaration)) {
9595
if (comment === undefined) continue;
96-
if (documentationComment.length) {
97-
documentationComment.push(lineBreakPart());
96+
const commentTextPart = textPart(comment);
97+
if (!contains(documentationComment, commentTextPart)) {
98+
if (documentationComment.length) {
99+
documentationComment.push(lineBreakPart());
100+
}
101+
documentationComment.push(commentTextPart);
98102
}
99-
documentationComment.push(textPart(comment));
100103
}
101104
});
102105
return documentationComment;

0 commit comments

Comments
 (0)