File tree 2 files changed +3
-4
lines changed
2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -24,18 +24,17 @@ class APIDocVisitor {
24
24
25
25
return sourceFile . statements . reduce ( ( directivesSoFar , statement ) => {
26
26
if ( statement . kind === ts . SyntaxKind . ClassDeclaration ) {
27
- return directivesSoFar . concat ( this . visitClassDeclaration ( statement ) ) ;
27
+ return directivesSoFar . concat ( this . visitClassDeclaration ( fileName , statement ) ) ;
28
28
}
29
29
30
30
return directivesSoFar ;
31
31
} , [ ] ) ;
32
32
}
33
33
34
- visitClassDeclaration ( classDeclaration ) {
34
+ visitClassDeclaration ( fileName , classDeclaration ) {
35
35
var symbol = this . program . getTypeChecker ( ) . getSymbolAtLocation ( classDeclaration . name ) ;
36
36
var description = ts . displayPartsToString ( symbol . getDocumentationComment ( ) ) ;
37
37
var className = classDeclaration . name . text ;
38
- var fileName = classDeclaration . parent . fileName ;
39
38
var directiveInfo ;
40
39
var members ;
41
40
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ describe('APIDocVisitor', function() {
6
6
function ( ) { expect ( apiDoc ( [ './misc/api-doc-test-cases/no-docs.ts' ] ) ) . toEqual ( { } ) ; } ) ;
7
7
8
8
it ( 'should extract basic info from directives and components' , function ( ) {
9
- var docs = apiDoc ( [ './ misc/api-doc-test-cases/directives-no-in-out.ts' ] ) ;
9
+ var docs = apiDoc ( [ 'misc/api-doc-test-cases/directives-no-in-out.ts' ] ) ;
10
10
11
11
expect ( Object . keys ( docs ) . length ) . toBe ( 2 ) ;
12
12
You can’t perform that action at this time.
0 commit comments