Skip to content

Commit

Permalink
Fix missing comments on @enum members
Browse files Browse the repository at this point in the history
Resolves #1880
  • Loading branch information
Gerrit0 committed Mar 26, 2022
1 parent ee292cf commit d122622
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Unreleased

### Bug Fixes

- Fixed missing comments on `@enum` style enum members defined in declaration files, #1880.

## v0.22.13 (2022-03-06)

### Features
Expand Down
1 change: 1 addition & 0 deletions src/lib/converter/converter.ts
Expand Up @@ -187,6 +187,7 @@ export class Converter extends ChildableComponent<
[ReflectionKind.EnumMember]: [
ts.SyntaxKind.EnumMember,
ts.SyntaxKind.PropertyAssignment,
ts.SyntaxKind.PropertySignature,
],
[ReflectionKind.Variable]: [ts.SyntaxKind.VariableDeclaration],
[ReflectionKind.Function]: [
Expand Down
11 changes: 11 additions & 0 deletions src/test/converter2/issues/gh1880.d.ts
@@ -0,0 +1,11 @@
/**
* This enumeration defines some values.
*
* @enum
*/
export declare const SomeEnum: {
/**
* This is the auto property.
*/
readonly AUTO: "auto";
};
9 changes: 9 additions & 0 deletions src/test/issueTests.ts
Expand Up @@ -335,4 +335,13 @@ export const issueTests: {
"Nested\n"
);
},

gh1880(project) {
const SomeEnum = query(project, "SomeEnum");
equal(SomeEnum.kind, ReflectionKind.Enum);
ok(SomeEnum.hasComment(), "Missing @enum variable comment");

const auto = query(project, "SomeEnum.AUTO");
ok(auto.hasComment(), "Missing @enum member comment");
},
};

0 comments on commit d122622

Please sign in to comment.