mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-16 15:51:35 -05:00
Merge pull request #38489 from microsoft/removeDuplicateInfo
Remove duplicate JSDoc comments
This commit is contained in:
@@ -89,17 +89,14 @@ namespace ts.JsDoc {
|
||||
// Eg. const a: Array<string> | Array<number>; a.length
|
||||
// The property length will have two declarations of property length coming
|
||||
// from Array<T> - Array<string> and Array<number>
|
||||
const documentationComment: SymbolDisplayPart[] = [];
|
||||
const documentationComment: string[] = [];
|
||||
forEachUnique(declarations, declaration => {
|
||||
for (const { comment } of getCommentHavingNodes(declaration)) {
|
||||
if (comment === undefined) continue;
|
||||
if (documentationComment.length) {
|
||||
documentationComment.push(lineBreakPart());
|
||||
}
|
||||
documentationComment.push(textPart(comment));
|
||||
pushIfUnique(documentationComment, comment);
|
||||
}
|
||||
});
|
||||
return documentationComment;
|
||||
return intersperse(map(documentationComment, textPart), lineBreakPart());
|
||||
}
|
||||
|
||||
function getCommentHavingNodes(declaration: Declaration): readonly (JSDoc | JSDocTag)[] {
|
||||
|
||||
Reference in New Issue
Block a user