File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1540,27 +1540,9 @@ namespace ts {
15401540 }
15411541
15421542 export function getJSDocParameterTags ( param : ParameterDeclaration ) : JSDocParameterTag [ ] | undefined {
1543- const func = param . parent ;
1544- const tags = getJSDocTags ( func ) ;
1545- if ( ! tags ) return undefined ;
1546-
1547- if ( ! param . name ) {
1548- // this is an anonymous jsdoc param from a `function(type1, type2): type3` specification
1549- const paramIndex = func . parameters . indexOf ( param ) ;
1550- Debug . assert ( paramIndex !== - 1 ) ;
1551- let curParamIndex = 0 ;
1552- for ( const tag of tags ) {
1553- if ( isJSDocParameterTag ( tag ) ) {
1554- if ( curParamIndex === paramIndex ) {
1555- return [ tag ] ;
1556- }
1557- curParamIndex ++ ;
1558- }
1559- }
1560- }
1561- else if ( param . name . kind === SyntaxKind . Identifier ) {
1562- const name = ( param . name as Identifier ) . text ;
1563- return tags . filter ( ( tag ) : tag is JSDocParameterTag => isJSDocParameterTag ( tag ) && tag . name . text === name ) as JSDocParameterTag [ ] ;
1543+ if ( param . name && isIdentifier ( param . name ) ) {
1544+ const name = param . name . text ;
1545+ return getJSDocTags ( param . parent ) . filter ( ( tag ) : tag is JSDocParameterTag => isJSDocParameterTag ( tag ) && tag . name . text === name ) as JSDocParameterTag [ ] ;
15641546 }
15651547 else {
15661548 // TODO: it's a destructured parameter, so it should look up an "object type" series of multiple lines
You can’t perform that action at this time.
0 commit comments