Skip to content

Fix length of JSDocTypedefTag #43401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compiler/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7997,7 +7997,7 @@ namespace ts {
}

const typedefTag = factory.createJSDocTypedefTag(tagName, typeExpression, fullName, comment);
return finishNode(typedefTag, start);
return finishNode(typedefTag, start, end);
}

function parseJSDocTypeNameWithNamespace(nested?: boolean) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions tests/baselines/reference/jsDocSignature-43394.baseline
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"marker": {
"fileName": "/tests/cases/fourslash/jsDocSignature-43394.ts",
"position": 58,
"name": ""
}
}
]
2 changes: 1 addition & 1 deletion tests/cases/fourslash/findAllRefsJsDocTypeDef_js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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|]}
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/fourslash/findAllRefsTypedef_importType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions tests/cases/fourslash/jsDocSignature-43394.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
///<reference path="fourslash.ts" />

/////**
//// * @typedef {Object} Foo
//// * @property {number} ...
//// * /**/@typedef {number} Bar
//// */

verify.baselineSignatureHelp();
2 changes: 1 addition & 1 deletion tests/cases/fourslash/jsdocTypedefTagSemanticMeaning0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;|]

Expand Down
2 changes: 1 addition & 1 deletion tests/cases/fourslash/server/jsdocTypedefTagRename02.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down