Skip to content

Commit 05ba3db

Browse files
committed
Fixes #134
1 parent 261a09a commit 05ba3db

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

typescript-json-schema.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,6 @@ export class JsonSchemaGenerator {
837837
public getMainFileSymbols(program: ts.Program): string[] {
838838
const files = program.getSourceFiles().filter(file => !file.isDeclarationFile);
839839
if (files.length) {
840-
const mainFile = files[0];
841840
return Object.keys(this.userSymbols).filter((key) => {
842841
const symbol = this.userSymbols[key].getSymbol();
843842
if (!symbol || !symbol.declarations || !symbol.declarations.length) {
@@ -847,7 +846,7 @@ export class JsonSchemaGenerator {
847846
while (node && node.parent) {
848847
node = node.parent;
849848
}
850-
return node === mainFile;
849+
return files.indexOf(node.getSourceFile()) > -1;
851850
});
852851
}
853852
return [];

0 commit comments

Comments
 (0)