We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c6c279 commit e62f960Copy full SHA for e62f960
src/services/jsDoc.ts
@@ -353,7 +353,8 @@ namespace ts.JsDoc {
353
}
354
355
const { commentOwner, parameters, hasReturn } = commentOwnerInfo;
356
- if (commentOwner.getStart(sourceFile) < position) {
+ const commentOwnerJSDoc = hasJSDocNodes(commentOwner) && commentOwner.jsDoc ? lastOrUndefined(commentOwner.jsDoc) : undefined;
357
+ if (commentOwner.getStart(sourceFile) < position || commentOwnerJSDoc && commentOwnerJSDoc !== existingDocComment) {
358
return undefined;
359
360
tests/cases/fourslash/docCommentTemplateWithExistingJSDoc.ts
@@ -0,0 +1,13 @@
1
+/// <reference path='fourslash.ts' />
2
+
3
+/////** /**/ */
4
+////
5
+/////**
6
+//// * @param {string} a
7
+//// * @param {string} b
8
+//// */
9
+////function foo(a, b) {
10
+//// return a + b;
11
+////}
12
13
+verify.noDocCommentTemplateAt("");
0 commit comments