Skip to content

Commit

Permalink
fix: Discover module comments for global files
Browse files Browse the repository at this point in the history
Resolves #1549
  • Loading branch information
Gerrit0 committed Mar 25, 2021
1 parent f0b9192 commit ce218e9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 44 deletions.
34 changes: 0 additions & 34 deletions .vscode/launch.json
Expand Up @@ -11,40 +11,6 @@
"skipFiles": ["<node_internals>/**"],
"type": "pwa-node",
"sourceMaps": true
},
{
"type": "node",
"request": "launch",
"name": "Debug self run",
"program": "${workspaceFolder}/bin/typedoc",
"cwd": "${workspaceFolder}/examples/self",
"args": [
"--mode",
"file",
"--name",
"TypeDoc Documentation",
"--tsconfig",
"../../tsconfig.json",
"--readme",
"../../README.md",
"--out",
"doc/",
"../../src/lib/"
]
},
{
"type": "node",
"request": "launch",
"name": "Debug Tests",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"cwd": "${workspaceRoot}",
"args": ["--no-timeouts", "dist/test/**/*.js"],
"outFiles": [
"${workspaceRoot}/lib/**/*.js",
"${workspaceRoot}/test/**/*.js"
],
"preLaunchTask": "build",
"sourceMaps": true
}
]
}
8 changes: 5 additions & 3 deletions src/lib/converter/context.ts
Expand Up @@ -213,15 +213,17 @@ export class Context {
finalizeDeclarationReflection(
reflection: DeclarationReflection,
symbol: ts.Symbol | undefined,
exportSymbol?: ts.Symbol
exportSymbol?: ts.Symbol,
commentNode?: ts.Node
) {
this.exportSymbol = exportSymbol;
this.converter.trigger(
ConverterEvents.CREATE_DECLARATION,
this,
reflection,
symbol &&
this.converter.getNodesForSymbol(symbol, reflection.kind)[0]
(symbol &&
this.converter.getNodesForSymbol(symbol, reflection.kind)[0]) ??
commentNode
);
this.exportSymbol = undefined;
}
Expand Down
7 changes: 6 additions & 1 deletion src/lib/converter/converter.ts
Expand Up @@ -323,7 +323,12 @@ export class Converter extends ChildableComponent<
void 0,
entryName
);
context.finalizeDeclarationReflection(reflection, symbol);
context.finalizeDeclarationReflection(
reflection,
symbol,
void 0,
node
);
moduleContext = context.withScope(reflection);
}

Expand Down
7 changes: 1 addition & 6 deletions src/lib/output/themes/DefaultTheme.ts
Expand Up @@ -432,12 +432,7 @@ export class NavigationBuilder {
target = target.parent;
}

if (
inScope &&
someModule instanceof DeclarationReflection &&
someModule.children &&
someModule.children.length > 0
) {
if (inScope && someModule instanceof DeclarationReflection) {
modules.push(someModule);
}
});
Expand Down

0 comments on commit ce218e9

Please sign in to comment.