Fix length of JSDocTypedefTag

(Accidentally broken in dcc27eb.)

Fixes #43394 and microsoft/tsserverfuzzer#309.
This commit is contained in:
Eli Barzilay
2021-03-29 16:06:53 -04:00
parent a3d207a905
commit c34b252e1e
8 changed files with 24 additions and 6 deletions
+1 -1
View File
@@ -8011,7 +8011,7 @@ namespace ts {
}
const typedefTag = factory.createJSDocTypedefTag(tagName, typeExpression, fullName, comment);
return finishNode(typedefTag, start);
return finishNode(typedefTag, start, end);
}
function parseJSDocTypeNameWithNamespace(nested?: boolean) {
@@ -18,7 +18,7 @@ tests/cases/conformance/jsdoc/declarations/file.js(6,5): error TS4084: Exported
==== tests/cases/conformance/jsdoc/declarations/file.js (3 errors) ====
/** @typedef {import('./base')} BaseFactory */
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS4084: Exported type alias 'BaseFactory' has or is using private name 'Base' from module "tests/cases/conformance/jsdoc/declarations/base".
/**
* @callback BaseFactoryFactory
@@ -0,0 +1,9 @@
[
{
"marker": {
"fileName": "/tests/cases/fourslash/jsDocSignature-43394.ts",
"position": 58,
"name": ""
}
}
]
@@ -5,7 +5,7 @@
// @allowJs: true
// @Filename: /a.js
/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|] |]*/
/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|]|] */
////
/////**
//// * @return {[|T|]}
@@ -4,7 +4,7 @@
// @Filename: /a.js
////module.exports = 0;
/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Foo|] |]*/
/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}Foo|]|] */
////const dummy = 0;
// @Filename: /b.js
@@ -0,0 +1,9 @@
///<reference path="fourslash.ts" />
/////**
//// * @typedef {Object} Foo
//// * @property {number} ...
//// * /**/@typedef {number} Bar
//// */
verify.baselineSignatureHelp();
@@ -3,7 +3,7 @@
// @allowJs: true
// @Filename: a.js
/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|] |]*/
/////** [|@typedef {number} [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 0 |}T|]|] */
////[|const [|{| "isWriteAccess": true, "isDefinition": true, "contextRangeIndex": 2 |}T|] = 1;|]
@@ -3,7 +3,7 @@
// @allowNonTsExtensions: true
// @Filename: jsDocTypedef_form2.js
////
//// /** [|@typedef {(string | number)} [|{| "contextRangeIndex": 0 |}NumberLike|] |]*/
//// /** [|@typedef {(string | number)} [|{| "contextRangeIndex": 0 |}NumberLike|]|] */
////
//// /** @type {[|NumberLike|]} */
//// var numberLike;