Skip to content

Commit

Permalink
Generate empty enum from subscription to keep namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
andooown committed Oct 21, 2023
1 parent 3169b12 commit 399c496
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/LexiconGenKit/Generator/Generator+Builders.swift
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ public extension Generator {
}
}

case .subscription:
try EnumDeclSyntax("enum \(raw: definition.name)") {}

default:
Generator.emptySyntax()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,15 @@ final class GeneratorBuildersTests: XCTestCase {
}
"""
)

// subscription
XCTAssertNoDifference(
try Generator.definition(makeDefinition(.subscription)).formatted().description,
"""
enum Foo {
}
"""
)
}

func testObjectSyntax() throws {
Expand Down

0 comments on commit 399c496

Please sign in to comment.