fix(52517): JSDoc Comment Template not provided when unrelated JSDoc with tag exists (#54132)

This commit is contained in:
Oleksandr T
2023-05-25 02:19:49 +03:00
committed by GitHub
parent 8ea3887f70
commit 8db251fb47
5 changed files with 27 additions and 4 deletions

View File

@@ -492,9 +492,7 @@ export function getDocCommentTemplateAtPosition(newLine: string, sourceFile: Sou
// * if the caret was directly in front of the object, then we add an extra line and indentation.
const openComment = "/**";
const closeComment = " */";
// If any of the existing jsDoc has tags, ignore adding new ones.
const hasTag = (commentOwnerJsDoc || []).some(jsDoc => !!jsDoc.tags);
const hasTag = length(getJSDocTags(commentOwner)) > 0;
if (tags && !hasTag) {
const preamble = openComment + newLine + indentationStr + " * ";