diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.argSynonymForParamTag.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.argSynonymForParamTag.json index 7e4346eba68..92b9cb450e6 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.argSynonymForParamTag.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.argSynonymForParamTag.json @@ -6,7 +6,7 @@ "0": { "kind": "JSDocParameterTag", "pos": 8, - "end": 27, + "end": 28, "atToken": { "kind": "AtToken", "pos": 8, @@ -44,6 +44,6 @@ }, "length": 1, "pos": 8, - "end": 27 + "end": 28 } } \ No newline at end of file diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.argumentSynonymForParamTag.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.argumentSynonymForParamTag.json index e46a09e6561..f398fb3af41 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.argumentSynonymForParamTag.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.argumentSynonymForParamTag.json @@ -6,7 +6,7 @@ "0": { "kind": "JSDocParameterTag", "pos": 8, - "end": 32, + "end": 33, "atToken": { "kind": "AtToken", "pos": 8, @@ -44,6 +44,6 @@ }, "length": 1, "pos": 8, - "end": 32 + "end": 33 } } \ No newline at end of file diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.oneParamTag.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.oneParamTag.json index af20bf8d6bb..e70fc95367f 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.oneParamTag.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.oneParamTag.json @@ -6,7 +6,7 @@ "0": { "kind": "JSDocParameterTag", "pos": 8, - "end": 29, + "end": 30, "atToken": { "kind": "AtToken", "pos": 8, @@ -44,6 +44,6 @@ }, "length": 1, "pos": 8, - "end": 29 + "end": 30 } } \ No newline at end of file diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.paramTag1.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.paramTag1.json index 5e0c3d21744..0dbdd83d2ba 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.paramTag1.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.paramTag1.json @@ -6,7 +6,7 @@ "0": { "kind": "JSDocParameterTag", "pos": 8, - "end": 29, + "end": 30, "atToken": { "kind": "AtToken", "pos": 8, @@ -44,6 +44,6 @@ }, "length": 1, "pos": 8, - "end": 29 + "end": 30 } } \ No newline at end of file diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.paramWithoutType.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.paramWithoutType.json index 17036e3729a..2ff182483d9 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.paramWithoutType.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.paramWithoutType.json @@ -6,7 +6,7 @@ "0": { "kind": "JSDocParameterTag", "pos": 8, - "end": 18, + "end": 19, "atToken": { "kind": "AtToken", "pos": 8, @@ -34,6 +34,6 @@ }, "length": 1, "pos": 8, - "end": 18 + "end": 19 } } \ No newline at end of file diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.twoParamTag2.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.twoParamTag2.json index d5d04dce69c..b51ab3598e6 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.twoParamTag2.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.twoParamTag2.json @@ -6,7 +6,7 @@ "0": { "kind": "JSDocParameterTag", "pos": 8, - "end": 29, + "end": 32, "atToken": { "kind": "AtToken", "pos": 8, @@ -45,7 +45,7 @@ "1": { "kind": "JSDocParameterTag", "pos": 34, - "end": 55, + "end": 56, "atToken": { "kind": "AtToken", "pos": 34, @@ -83,6 +83,6 @@ }, "length": 2, "pos": 8, - "end": 55 + "end": 56 } } \ No newline at end of file diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.twoParamTagOnSameLine.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.twoParamTagOnSameLine.json index 4c85b2c9aed..3c20d5edcbc 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.twoParamTagOnSameLine.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.twoParamTagOnSameLine.json @@ -6,7 +6,7 @@ "0": { "kind": "JSDocParameterTag", "pos": 8, - "end": 29, + "end": 30, "atToken": { "kind": "AtToken", "pos": 8, @@ -45,7 +45,7 @@ "1": { "kind": "JSDocParameterTag", "pos": 30, - "end": 51, + "end": 52, "atToken": { "kind": "AtToken", "pos": 30, @@ -83,6 +83,6 @@ }, "length": 2, "pos": 8, - "end": 51 + "end": 52 } } \ No newline at end of file diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.typedefTagWithChildrenTags.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.typedefTagWithChildrenTags.json index 7ef64f5a971..7a8f9c4bcc9 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.typedefTagWithChildrenTags.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.typedefTagWithChildrenTags.json @@ -82,12 +82,6 @@ "end": 56, "text": "property" }, - "name": { - "kind": "Identifier", - "pos": 66, - "end": 69, - "text": "age" - }, "typeExpression": { "kind": "JSDocTypeExpression", "pos": 57, @@ -97,6 +91,18 @@ "pos": 58, "end": 64 } + }, + "postParameterName": { + "kind": "Identifier", + "pos": 66, + "end": 69, + "text": "age" + }, + "name": { + "kind": "Identifier", + "pos": 66, + "end": 69, + "text": "age" } }, { @@ -114,12 +120,6 @@ "end": 83, "text": "property" }, - "name": { - "kind": "Identifier", - "pos": 93, - "end": 97, - "text": "name" - }, "typeExpression": { "kind": "JSDocTypeExpression", "pos": 84, @@ -129,6 +129,18 @@ "pos": 85, "end": 91 } + }, + "postParameterName": { + "kind": "Identifier", + "pos": 93, + "end": 97, + "text": "name" + }, + "name": { + "kind": "Identifier", + "pos": 93, + "end": 97, + "text": "name" } } ] diff --git a/tests/baselines/reference/checkJsdocTypedefInParamTag1.js b/tests/baselines/reference/checkJsdocTypedefInParamTag1.js index d4983bfd581..8ef81a71cb8 100644 --- a/tests/baselines/reference/checkJsdocTypedefInParamTag1.js +++ b/tests/baselines/reference/checkJsdocTypedefInParamTag1.js @@ -11,7 +11,18 @@ */ function foo(opts) {} -foo({x: 'abc'}); +foo({x: 'abc'}); + +/** + * @typedef {Object} AnotherOpts + * @property anotherX {string} + * @property anotherY {string=} + * + * @param {AnotherOpts} opts + */ +function foo1(opts) {} + +foo1({anotherX: "world"}); //// [0.js] // @ts-check @@ -26,3 +37,12 @@ foo({x: 'abc'}); */ function foo(opts) { } foo({ x: 'abc' }); +/** + * @typedef {Object} AnotherOpts + * @property anotherX {string} + * @property anotherY {string=} + * + * @param {AnotherOpts} opts + */ +function foo1(opts) { } +foo1({ anotherX: "world" }); diff --git a/tests/baselines/reference/checkJsdocTypedefInParamTag1.symbols b/tests/baselines/reference/checkJsdocTypedefInParamTag1.symbols index cd2455797b4..596e5ca89c5 100644 --- a/tests/baselines/reference/checkJsdocTypedefInParamTag1.symbols +++ b/tests/baselines/reference/checkJsdocTypedefInParamTag1.symbols @@ -17,3 +17,18 @@ foo({x: 'abc'}); >foo : Symbol(foo, Decl(0.js, 0, 0)) >x : Symbol(x, Decl(0.js, 12, 5)) +/** + * @typedef {Object} AnotherOpts + * @property anotherX {string} + * @property anotherY {string=} + * + * @param {AnotherOpts} opts + */ +function foo1(opts) {} +>foo1 : Symbol(foo1, Decl(0.js, 12, 16)) +>opts : Symbol(opts, Decl(0.js, 21, 14)) + +foo1({anotherX: "world"}); +>foo1 : Symbol(foo1, Decl(0.js, 12, 16)) +>anotherX : Symbol(anotherX, Decl(0.js, 23, 6)) + diff --git a/tests/baselines/reference/checkJsdocTypedefInParamTag1.types b/tests/baselines/reference/checkJsdocTypedefInParamTag1.types index cc923e33030..82b17d71a4a 100644 --- a/tests/baselines/reference/checkJsdocTypedefInParamTag1.types +++ b/tests/baselines/reference/checkJsdocTypedefInParamTag1.types @@ -20,3 +20,21 @@ foo({x: 'abc'}); >x : string >'abc' : "abc" +/** + * @typedef {Object} AnotherOpts + * @property anotherX {string} + * @property anotherY {string=} + * + * @param {AnotherOpts} opts + */ +function foo1(opts) {} +>foo1 : (opts: { anotherX: string; anotherY?: string; }) => void +>opts : { anotherX: string; anotherY?: string; } + +foo1({anotherX: "world"}); +>foo1({anotherX: "world"}) : void +>foo1 : (opts: { anotherX: string; anotherY?: string; }) => void +>{anotherX: "world"} : { anotherX: string; } +>anotherX : string +>"world" : "world" + diff --git a/tests/cases/conformance/jsdoc/checkJsdocTypedefInParamTag1.ts b/tests/cases/conformance/jsdoc/checkJsdocTypedefInParamTag1.ts index 80ca21bd4ff..853a65766ce 100644 --- a/tests/cases/conformance/jsdoc/checkJsdocTypedefInParamTag1.ts +++ b/tests/cases/conformance/jsdoc/checkJsdocTypedefInParamTag1.ts @@ -14,4 +14,15 @@ */ function foo(opts) {} -foo({x: 'abc'}); \ No newline at end of file +foo({x: 'abc'}); + +/** + * @typedef {Object} AnotherOpts + * @property anotherX {string} + * @property anotherY {string=} + * + * @param {AnotherOpts} opts + */ +function foo1(opts) {} + +foo1({anotherX: "world"}); \ No newline at end of file