Skip to content

Add custom codegen hook before shape generation#1469

Merged
JordonPhillips merged 1 commit intosmithy-lang:mainfrom
JordonPhillips:customize-before-shape-gen
Oct 27, 2022
Merged

Add custom codegen hook before shape generation#1469
JordonPhillips merged 1 commit intosmithy-lang:mainfrom
JordonPhillips:customize-before-shape-gen

Conversation

@JordonPhillips
Copy link
Copy Markdown
Contributor

@JordonPhillips JordonPhillips commented Oct 26, 2022

Some languages need to generate code before shapes are generated. Previously such languages could have used the service generation hook to perform this, but that was moved to occur after generating the other shapes.

Python particularly needs this because the language has this cool feature where it can't intelligently resolve everything at the top level of a file. For example, you have to define a parent class earlier in the file than any subclasses. Python generates service-specific errors so this is fairly critical.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Some languages need to generate code before shapes are generated.
Previously such languages could have used the service generation hook
to perform this, but that was moved to occur after generating the
other shapes.
@JordonPhillips JordonPhillips requested a review from a team as a code owner October 26, 2022 10:51
@JordonPhillips JordonPhillips merged commit 96882ea into smithy-lang:main Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants