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

This commit is contained in:
Oleksandr T
2022-03-30 15:36:47 -07:00
committed by GitHub
parent 3c6c2799b6
commit e62f960648
2 changed files with 15 additions and 1 deletions
+2 -1
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;
}
@@ -0,0 +1,13 @@
/// <reference path='fourslash.ts' />
/////** /**/ */
////
/////**
//// * @param {string} a
//// * @param {string} b
//// */
////function foo(a, b) {
//// return a + b;
////}
verify.noDocCommentTemplateAt("");