fix(47733): omit JSDoc comment template suggestion on node with existing JSDoc (#47748)

This commit is contained in:
Oleksandr T
2022-03-31 01:36:47 +03:00
committed by GitHub
parent 3c6c2799b6
commit e62f960648
2 changed files with 15 additions and 1 deletions

View File

@@ -353,7 +353,8 @@ namespace ts.JsDoc {
}
const { commentOwner, parameters, hasReturn } = commentOwnerInfo;
if (commentOwner.getStart(sourceFile) < position) {
const commentOwnerJSDoc = hasJSDocNodes(commentOwner) && commentOwner.jsDoc ? lastOrUndefined(commentOwner.jsDoc) : undefined;
if (commentOwner.getStart(sourceFile) < position || commentOwnerJSDoc && commentOwnerJSDoc !== existingDocComment) {
return undefined;
}