File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1606,8 +1606,19 @@ namespace ts {
16061606 return undefined ;
16071607 }
16081608 const name = node . name . escapedText ;
1609- const func = getJSDocHost ( node ) ;
1610- if ( ! isFunctionLike ( func ) ) {
1609+ const decl = getJSDocHost ( node ) ;
1610+ let func : FunctionLike ;
1611+ if ( isExpressionStatement ( decl ) && isBinaryExpression ( decl . expression ) && isFunctionLike ( decl . expression . right ) ) {
1612+ func = decl . expression . right ;
1613+ }
1614+ else if ( isVariableStatement ( decl ) && decl . declarationList . declarations . length === 1 && isVariableDeclaration ( decl . declarationList . declarations [ 0 ] )
1615+ && isFunctionLike ( decl . declarationList . declarations [ 0 ] . initializer ) ) {
1616+ func = decl . declarationList . declarations [ 0 ] . initializer as FunctionLike ;
1617+ }
1618+ else if ( isFunctionLike ( decl ) ) {
1619+ func = decl ;
1620+ }
1621+ else {
16111622 return undefined ;
16121623 }
16131624 const parameter = find ( func . parameters , p =>
You can’t perform that action at this time.
0 commit comments