File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7030,6 +7030,7 @@ namespace ts {
70307030 // - class decls
70317031 let containingFunction = < FunctionDeclaration > getAncestor ( tokenAtPos , SyntaxKind . FunctionDeclaration ) ;
70327032
7033+
70337034 if ( ! containingFunction || containingFunction . getStart ( ) < position ) {
70347035 return undefined ;
70357036 }
@@ -7043,9 +7044,15 @@ namespace ts {
70437044 // TODO: call a helper method instead once PR #4133 gets merged in.
70447045 const newLine = host . getNewLine ? host . getNewLine ( ) : "\r\n" ;
70457046
7046- let docParams = parameters . reduce ( ( prev , cur , index ) =>
7047- prev +
7048- indentationStr + " * @param " + ( cur . name . kind === SyntaxKind . Identifier ? ( < Identifier > cur . name ) . text : "param" + index ) + newLine , "" ) ;
7047+ let docParams = "" ;
7048+ for ( let i = 0 , numParams = parameters . length ; i < numParams ; i ++ ) {
7049+ const currentName = parameters [ i ] . name ;
7050+ const paramName = currentName . kind === SyntaxKind . Identifier ?
7051+ ( < Identifier > currentName ) . text :
7052+ "param" + i ;
7053+
7054+ docParams += `${ indentationStr } * @param ${ paramName } ${ newLine } ` ;
7055+ }
70497056
70507057 // A doc comment consists of the following
70517058 // * The opening comment line
You can’t perform that action at this time.
0 commit comments