Skip to content

Commit c34b252

Browse files
committed
Fix length of JSDocTypedefTag
(Accidentally broken in dcc27eb.) Fixes microsoft#43394 and microsoft/tsserverfuzzer#309.
1 parent a3d207a commit c34b252

8 files changed

+24
-6
lines changed

src/compiler/parser.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8011,7 +8011,7 @@ namespace ts {
80118011
}
80128012

80138013
const typedefTag = factory.createJSDocTypedefTag(tagName, typeExpression, fullName, comment);
8014-
return finishNode(typedefTag, start);
8014+
return finishNode(typedefTag, start, end);
80158015
}
80168016

80178017
function parseJSDocTypeNameWithNamespace(nested?: boolean) {

tests/baselines/reference/jsDeclarationsParameterTagReusesInputNodeInEmit1.errors.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ tests/cases/conformance/jsdoc/declarations/file.js(6,5): error TS4084: Exported
1818

1919
==== tests/cases/conformance/jsdoc/declarations/file.js (3 errors) ====
2020
/** @typedef {import('./base')} BaseFactory */
21-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2222
!!! error TS4084: Exported type alias 'BaseFactory' has or is using private name 'Base' from module "tests/cases/conformance/jsdoc/declarations/base".
2323
/**
2424
* @callback BaseFactoryFactory
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[
2+
{
3+
"marker": {
4+
"fileName": "/tests/cases/fourslash/jsDocSignature-43394.ts",
5+
"position": 58,
6+
"name": ""
7+
}
8+
}
9+
]

tests/cases/fourslash/findAllRefsJsDocTypeDef_js.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// @allowJs: true
66

77
// @Filename: /a.js
8-
/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|] |]*/
8+
/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|]|] */
99
////
1010
/////**
1111
//// * @return {[|T|]}

tests/cases/fourslash/findAllRefsTypedef_importType.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// @Filename: /a.js
66
////module.exports = 0;
7-
/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Foo|] |]*/
7+
/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Foo|]|] */
88
////const dummy = 0;
99

1010
// @Filename: /b.js
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
///<reference path="fourslash.ts" />
2+
3+
/////**
4+
//// * @typedef {Object} Foo
5+
//// * @property {number} ...
6+
//// * /**/@typedef {number} Bar
7+
//// */
8+
9+
verify.baselineSignatureHelp();

tests/cases/fourslash/jsdocTypedefTagSemanticMeaning0.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @allowJs: true
44
// @Filename: a.js
55

6-
/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|] |]*/
6+
/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|]|] */
77

88
////[|const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}T|] = 1;|]
99

tests/cases/fourslash/server/jsdocTypedefTagRename02.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @allowNonTsExtensions: true
44
// @Filename: jsDocTypedef_form2.js
55
////
6-
//// /** [|@typedef {(string | number)} [|{| "contextRangeIndex": 0 |}NumberLike|] |]*/
6+
//// /** [|@typedef {(string | number)} [|{| "contextRangeIndex": 0 |}NumberLike|]|] */
77
////
88
//// /** @type {[|NumberLike|]} */
99
//// var numberLike;

0 commit comments

Comments
 (0)