@@ -13,6 +13,8 @@ import { Component, ConverterComponent } from '../components';
13
13
import { parseComment , getRawComment } from '../factories/comment' ;
14
14
import { Converter } from '../converter' ;
15
15
import { Context } from '../context' ;
16
+ import { partition , uniq } from 'lodash' ;
17
+ import { SourceReference } from '../../models' ;
16
18
17
19
/**
18
20
* Structure used by [[ContainerCommentHandler]] to store discovered module comments.
@@ -226,12 +228,15 @@ export class CommentPlugin extends ConverterComponent {
226
228
hidden . forEach ( reflection => project . removeReflection ( reflection , true ) ) ;
227
229
228
230
// remove functions with empty signatures after their signatures have been removed
229
- const hiddenMethods = hidden . map ( reflection => reflection . parent ! )
230
- . filter ( method =>
231
- method . kindOf ( ReflectionKind . FunctionOrMethod )
232
- && method instanceof DeclarationReflection
233
- && method . signatures ?. length === 0 ) ;
234
- hiddenMethods . forEach ( reflection => project . removeReflection ( reflection , true ) ) ;
231
+ const [ allRemoved , someRemoved ] = partition (
232
+ hidden . map ( reflection => reflection . parent ! )
233
+ . filter ( method => method . kindOf ( ReflectionKind . FunctionOrMethod ) ) as DeclarationReflection [ ] ,
234
+ method => method . signatures ?. length === 0
235
+ ) ;
236
+ allRemoved . forEach ( reflection => project . removeReflection ( reflection , true ) ) ;
237
+ someRemoved . forEach ( reflection => {
238
+ reflection . sources = uniq ( reflection . signatures ! . reduce < SourceReference [ ] > ( ( c , s ) => c . concat ( s . sources || [ ] ) , [ ] ) ) ;
239
+ } ) ;
235
240
}
236
241
237
242
/**
0 commit comments