mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
fix(47733): omit JSDoc comment template suggestion on node with existing JSDoc (#47748)
This commit is contained in:
@@ -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("");
|
||||
Reference in New Issue
Block a user