Skip to content

Commit 1e6583d

Browse files
committed
Move enum doc to tsdoc from inline
1 parent 03c6d59 commit 1e6583d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/EnumGenerator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* <p>We will generate the following:
3636
*
3737
* <pre>{@code
38-
* export const /* enum *&#47 TypedYesNo = {
38+
* export const TypedYesNo = {
3939
* YES: "YEP",
4040
* NO: "NOPE",
4141
* } as const;
@@ -88,8 +88,8 @@ private void generateUnnamedEnum() {
8888

8989
// Named enums generate an actual enum type.
9090
private void generateNamedEnum() {
91-
writer.writeDocs("@public")
92-
.openBlock("export const /* enum */ $L = {", "} as const", symbol.getName(), () -> {
91+
writer.writeDocs("@public\n@enum")
92+
.openBlock("export const $L = {", "} as const", symbol.getName(), () -> {
9393
// Sort the named values to ensure a stable order and sane diffs.
9494
// TODO: Should we just sort these in the trait itself?
9595
enumTrait.getValues()

smithy-typescript-codegen/src/test/java/software/amazon/smithy/typescript/codegen/EnumGeneratorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void generatesNamedEnums() {
3333
Symbol symbol = new SymbolVisitor(model, settings).toSymbol(shape);
3434
new EnumGenerator(shape, symbol, writer).run();
3535

36-
assertThat(writer.toString(), containsString("export const /* enum */ Baz = {"));
36+
assertThat(writer.toString(), containsString("export const Baz = {"));
3737
assertThat(writer.toString(), stringContainsInOrder("BAR: \"BAR\",", "FOO: \"FOO\""));
3838
assertThat(writer.toString(), containsString("export type Baz = typeof Baz[keyof typeof Baz]"));
3939
}

0 commit comments

Comments
 (0)