-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add directed codegen #681
Conversation
a698e45
to
4ab9ea1
Compare
|
||
class DirectedSwiftCodegen(val context: PluginContext) : | ||
DirectedCodegen<GenerationContext, SwiftSettings, SwiftIntegration> { | ||
private val LOGGER = Logger.getLogger(javaClass.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is there a Kotlin logging library we should be using instead of the Java one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is an "official" kotlin logging library so I am using the Java one for now. Can add it later if needed to.
smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/ImportDeclarations.kt
Outdated
Show resolved
Hide resolved
...hy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/core/CodegenContext.kt
Outdated
Show resolved
Hide resolved
smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/CodegenVisitor.kt
Outdated
Show resolved
Hide resolved
...y-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/DirectedSwiftCodegen.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A suggestion and a question.
...codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/SwiftIntegration.kt
Show resolved
Hide resolved
putFormatter('D', SwiftSymbolFormatter(shouldSetDefault = true, shouldRenderOptional = true)) | ||
putFormatter('T', SwiftSymbolFormatter(shouldSetDefault = false, shouldRenderOptional = true)) | ||
putFormatter('N', SwiftSymbolFormatter(shouldSetDefault = false, shouldRenderOptional = false)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the usecases for these formatters? Could comments be added here for quick reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving pending CI passes.
For ktlint
, you can run ./gradlew ktlint
and ./gradlew ktlintFormat
...y-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/SwiftImportContainer.kt
Outdated
Show resolved
Hide resolved
…emove CodegenVisitor and add missing CustomDebugStringConvertibleGenerator to directed codegen
Description of changes
Scope
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.