Skip to content

Commit

Permalink
Fixed missing comments for NamespaceExport declarations
Browse files Browse the repository at this point in the history
Resolves #1973
  • Loading branch information
Gerrit0 committed Jul 1, 2022
1 parent 7d71d35 commit 92df4e7
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,7 @@
- TypeDoc will no longer crash if a comment contains an empty `@example` tag, #1967.
- TypeDoc will now detect attempted inheritance from accessors and inherit from the getter or setter, #1968.
- `intentionallyNotExported` will now properly respect qualified names, #1972.
- Fixed missing namespace comments on `export * as NS` declarations, #1973.
- Validation warnings caused by missing documentation will now be formatted like other warnings which reference a declaration.
- TypeDoc will no longer warn if both the `get` and `set` signatures of an accessor have a comment.

Expand Down
1 change: 1 addition & 0 deletions src/lib/converter/comments/discovery.ts
Expand Up @@ -16,6 +16,7 @@ const wantedKinds: Record<ReflectionKind, ts.SyntaxKind[]> = {
ts.SyntaxKind.SourceFile,
ts.SyntaxKind.BindingElement,
ts.SyntaxKind.ExportSpecifier,
ts.SyntaxKind.NamespaceExport,
],
[ReflectionKind.Enum]: [
ts.SyntaxKind.EnumDeclaration,
Expand Down
9 changes: 9 additions & 0 deletions src/test/converter2/issues/gh1973/a.ts
@@ -0,0 +1,9 @@
/**
* A module
* @module
*/

/**
* Comment for a
*/
export const a = "a";
9 changes: 9 additions & 0 deletions src/test/converter2/issues/gh1973/b.ts
@@ -0,0 +1,9 @@
/**
* B module
* @module
*/

/**
* Comment for b
*/
export const b = "b";
7 changes: 7 additions & 0 deletions src/test/converter2/issues/gh1973/index.ts
@@ -0,0 +1,7 @@
/**
* A override
*/
export * as A from "./a.js";

// No override
export * as B from "./b.js";
8 changes: 8 additions & 0 deletions src/test/issueTests.ts
Expand Up @@ -555,4 +555,12 @@ export const issueTests: {
);
equal(comments, ["getter", "getter", "setter"]);
},

gh1973(project) {
const comments = ["A", "B"].map((n) =>
Comment.combineDisplayParts(query(project, n).comment?.summary)
);

equal(comments, ["A override", "B module"]);
},
};

0 comments on commit 92df4e7

Please sign in to comment.