Skip to content

Commit

Permalink
Update open enum type rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
kubukoz committed Oct 10, 2023
1 parent 2fb3cb0 commit c309fed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions modules/core/src/test/smithy/demo.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,13 @@ map PowerMap {
value: Hero
}

@openEnum
enum Power {
ICE = "Ice"
FIRE = "Fire"
LIGHTNING = "Lightning"
WIND = "Wind"
}

@openEnum
intEnum PrivacyTier {
PUBLIC = 0
PRIVATE = 1
Expand Down Expand Up @@ -279,3 +277,15 @@ map SampleSparseMap {
key: String
value: Integer
}

@openEnum
enum OpenStringEnum {
ICE
FIRE
}

@openEnum
intEnum OpenIntEnum {
ICE = 1
FIRE = 2
}
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ object CompletionItem {
case e @ EnumerationSchema(_, _, _, _, _) =>
e.tag match {
case ClosedIntEnum => now(s"intEnum ${e.shapeId.name}")
case OpenIntEnum(_) => now(s"intEnum(open) ${e.shapeId.name}")
case OpenStringEnum(_) => now(s"enum(open) ${e.shapeId.name}")
case OpenIntEnum(_) => now(s"@openEnum intEnum ${e.shapeId.name}")
case OpenStringEnum(_) => now(s"@openEnum enum ${e.shapeId.name}")
case ClosedStringEnum => now(s"enum ${e.shapeId.name}")
}

Expand Down

0 comments on commit c309fed

Please sign in to comment.