-
Notifications
You must be signed in to change notification settings - Fork 190
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
Move ClientBuilderGenerator
out of codegen-client
#2159
Conversation
...c/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/InstantiatorTest.kt
Outdated
Show resolved
Hide resolved
{ | ||
"k1": { "map": {} }, | ||
"k2": { "map": { "k3": {} } }, | ||
"k3": { } | ||
} | ||
""", |
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.
ktlint complained here and below.
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
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.
This looks mostly good, just a couple comments.
My current work on crate reorganization is getting blocked on this PR, so I'm open to just merging it as is (once CI passes) and I can address the comments myself.
interface BuilderGenerator { | ||
fun render(writer: RustWriter) | ||
fun renderConvenienceMethod(implBlock: RustWriter) | ||
} |
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'm not a fan of this since it makes the builders inherit from unit test code, but it seems like this might go away due to #2342? Perhaps we merge that PR first and then delete this BuilderGenerator
interface.
@@ -370,3 +376,23 @@ open class Instantiator( | |||
else -> throw CodegenException("Unrecognized shape `$shape`") | |||
} | |||
} | |||
fun StructureShape.builderSymbol(symbolProvider: RustSymbolProvider): Symbol { |
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.
We should add a symbolForBuilder(shape: Shape)
to RustSymbolProvider
instead of this approach (there are examples in there for operation error and event stream error symbols). The module location needs to be configurable for my crate reorganization work.
Hmmm... Digging into this more, I'm thinking we should actually keep a minimal |
This PR has been sitting around for a while. Is it still relevant or can we close it? |
Motivation and Context
Closes #1970.
Description
Move a whole bunch of client-specific code from
codegen-core
tocodegen-client
.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.