mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 02:33:53 -06:00
Fix doc comment template on assignment expressions (#38032)
This commit is contained in:
parent
5d78cbdbbd
commit
547fd12c2f
@ -363,6 +363,8 @@ namespace ts.JsDoc {
|
||||
// want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'.
|
||||
return commentOwner.parent.kind === SyntaxKind.ModuleDeclaration ? undefined : { commentOwner };
|
||||
|
||||
case SyntaxKind.ExpressionStatement:
|
||||
return getCommentOwnerInfoWorker((commentOwner as ExpressionStatement).expression);
|
||||
case SyntaxKind.BinaryExpression: {
|
||||
const be = commentOwner as BinaryExpression;
|
||||
if (getAssignmentDeclarationKind(be) === AssignmentDeclarationKind.None) {
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @allowJs: true
|
||||
// @checkJs: true
|
||||
|
||||
// @Filename: index.js
|
||||
//// /** /**/ */
|
||||
//// exports.foo = (a) => {};
|
||||
|
||||
|
||||
verify.docCommentTemplateAt("", 8,
|
||||
`/**
|
||||
*
|
||||
* @param {any} a
|
||||
*/`);
|
||||
Loading…
x
Reference in New Issue
Block a user