mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
fix(40685): fix generating docs for arrow functions (#40728)
This commit is contained in:
parent
66c877f57a
commit
1e49ad8370
@ -329,6 +329,7 @@ namespace ts.JsDoc {
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
case SyntaxKind.Constructor:
|
||||
case SyntaxKind.MethodSignature:
|
||||
case SyntaxKind.ArrowFunction:
|
||||
const { parameters } = commentOwner as FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | MethodSignature;
|
||||
return { commentOwner, parameters };
|
||||
|
||||
|
||||
@ -8,10 +8,15 @@ const multiLineOffset = 12;
|
||||
//// foo() {
|
||||
//// return undefined;
|
||||
//// }
|
||||
////
|
||||
//// /*1*/
|
||||
//// [1 + 2 + 3 + Math.rand()](x: number, y: string, z = true) { }
|
||||
////
|
||||
//// /*2*/
|
||||
//// m: function(a) {}
|
||||
//// m1: function(a) {}
|
||||
////
|
||||
//// /*3*/
|
||||
//// m2: (a: string, b: string) => {}
|
||||
////}
|
||||
|
||||
verify.docCommentTemplateAt("0", singleLineOffset, "/** */");
|
||||
@ -23,9 +28,16 @@ verify.docCommentTemplateAt("1", multiLineOffset,
|
||||
* @param y
|
||||
* @param z
|
||||
*/`);
|
||||
|
||||
|
||||
verify.docCommentTemplateAt("2", multiLineOffset,
|
||||
`/**
|
||||
*
|
||||
* @param a
|
||||
*/`);
|
||||
|
||||
verify.docCommentTemplateAt("3", multiLineOffset,
|
||||
`/**
|
||||
*
|
||||
* @param a
|
||||
* @param b
|
||||
*/`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user