Skip to content

Commit ce218e9

Browse files
committed
fix: Discover module comments for global files
Resolves #1549
1 parent f0b9192 commit ce218e9

File tree

4 files changed

+12
-44
lines changed

4 files changed

+12
-44
lines changed

.vscode/launch.json

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,6 @@
1111
"skipFiles": ["<node_internals>/**"],
1212
"type": "pwa-node",
1313
"sourceMaps": true
14-
},
15-
{
16-
"type": "node",
17-
"request": "launch",
18-
"name": "Debug self run",
19-
"program": "${workspaceFolder}/bin/typedoc",
20-
"cwd": "${workspaceFolder}/examples/self",
21-
"args": [
22-
"--mode",
23-
"file",
24-
"--name",
25-
"TypeDoc Documentation",
26-
"--tsconfig",
27-
"../../tsconfig.json",
28-
"--readme",
29-
"../../README.md",
30-
"--out",
31-
"doc/",
32-
"../../src/lib/"
33-
]
34-
},
35-
{
36-
"type": "node",
37-
"request": "launch",
38-
"name": "Debug Tests",
39-
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
40-
"cwd": "${workspaceRoot}",
41-
"args": ["--no-timeouts", "dist/test/**/*.js"],
42-
"outFiles": [
43-
"${workspaceRoot}/lib/**/*.js",
44-
"${workspaceRoot}/test/**/*.js"
45-
],
46-
"preLaunchTask": "build",
47-
"sourceMaps": true
4814
}
4915
]
5016
}

src/lib/converter/context.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,17 @@ export class Context {
213213
finalizeDeclarationReflection(
214214
reflection: DeclarationReflection,
215215
symbol: ts.Symbol | undefined,
216-
exportSymbol?: ts.Symbol
216+
exportSymbol?: ts.Symbol,
217+
commentNode?: ts.Node
217218
) {
218219
this.exportSymbol = exportSymbol;
219220
this.converter.trigger(
220221
ConverterEvents.CREATE_DECLARATION,
221222
this,
222223
reflection,
223-
symbol &&
224-
this.converter.getNodesForSymbol(symbol, reflection.kind)[0]
224+
(symbol &&
225+
this.converter.getNodesForSymbol(symbol, reflection.kind)[0]) ??
226+
commentNode
225227
);
226228
this.exportSymbol = undefined;
227229
}

src/lib/converter/converter.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,12 @@ export class Converter extends ChildableComponent<
323323
void 0,
324324
entryName
325325
);
326-
context.finalizeDeclarationReflection(reflection, symbol);
326+
context.finalizeDeclarationReflection(
327+
reflection,
328+
symbol,
329+
void 0,
330+
node
331+
);
327332
moduleContext = context.withScope(reflection);
328333
}
329334

src/lib/output/themes/DefaultTheme.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -432,12 +432,7 @@ export class NavigationBuilder {
432432
target = target.parent;
433433
}
434434

435-
if (
436-
inScope &&
437-
someModule instanceof DeclarationReflection &&
438-
someModule.children &&
439-
someModule.children.length > 0
440-
) {
435+
if (inScope && someModule instanceof DeclarationReflection) {
441436
modules.push(someModule);
442437
}
443438
});

0 commit comments

Comments
 (0)