File tree Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -68,18 +68,21 @@ export default iterateJsdoc(({
68
68
} )
69
69
. value ( ) ;
70
70
71
- let closureGenericTypes = [ ] ;
71
+ let templateTags = utils . getPresentTags ( 'template' ) ;
72
72
const classJsdoc = utils . getClassJsdoc ( ) ;
73
73
if ( classJsdoc && classJsdoc . tags ) {
74
- closureGenericTypes = classJsdoc . tags
75
- . filter ( ( tag ) => {
76
- return tag . tag === 'template' ;
77
- } )
78
- . flatMap ( ( tag ) => {
79
- return jsdocUtils . parseClosureTemplateTag ( tag ) ;
80
- } ) ;
74
+ templateTags = templateTags . concat (
75
+ classJsdoc . tags
76
+ . filter ( ( tag ) => {
77
+ return tag . tag === 'template' ;
78
+ } )
79
+ ) ;
81
80
}
82
81
82
+ const closureGenericTypes = templateTags . flatMap ( ( tag ) => {
83
+ return jsdocUtils . parseClosureTemplateTag ( tag ) ;
84
+ } ) ;
85
+
83
86
const allDefinedTypes = globalScope . variables . map ( ( variable ) => {
84
87
return variable . name ;
85
88
} )
Original file line number Diff line number Diff line change @@ -439,6 +439,17 @@ export default {
439
439
}
440
440
}
441
441
} ,
442
+ {
443
+ code : `
444
+ /**
445
+ * @template TEMPLATE_TYPE
446
+ * @param {TEMPLATE_TYPE} bar
447
+ * @return {TEMPLATE_TYPE}
448
+ */
449
+ function foo (bar) {
450
+ };
451
+ `
452
+ } ,
442
453
{
443
454
code : `
444
455
/**
You can’t perform that action at this time.
0 commit comments