Skip to content

Commit

Permalink
Add temporary module rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Barber committed Sep 1, 2022
1 parent be6214e commit d3d6880
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import software.amazon.smithy.model.knowledge.TopDownIndex
import software.amazon.smithy.model.shapes.OperationShape
import software.amazon.smithy.rust.codegen.rustlang.RustModule
import software.amazon.smithy.rust.codegen.rustlang.RustWriter
import software.amazon.smithy.rust.codegen.server.smithy.generators.protocol.ServerProtocol
import software.amazon.smithy.rust.codegen.server.smithy.generators.protocol.ServerProtocolTestGenerator
import software.amazon.smithy.rust.codegen.smithy.CoreCodegenContext
import software.amazon.smithy.rust.codegen.smithy.RustCrate
Expand Down Expand Up @@ -66,6 +67,28 @@ open class ServerServiceGenerator(
) { writer ->
renderOperationRegistry(writer, operations)
}

// TODO: Remove, this is temporary.
rustCrate.withModule(
RustModule.public("operations", "TODO"),
) { writer ->
for (operation in operations) {
ServerOperationGenerator(coreCodegenContext, operation).render(writer)
}
}

// TODO: Remove, this is temporary.
rustCrate.withModule(
RustModule.public("services", "TODO"),
) { writer ->
val serverProtocol = ServerProtocol.fromCoreProtocol(coreCodegenContext.runtimeConfig, protocol)
ServerServiceGeneratorV2(
coreCodegenContext.runtimeConfig,
coreCodegenContext.serviceShape,
serverProtocol,
).render(writer)
}

renderExtras(operations)
}

Expand Down

0 comments on commit d3d6880

Please sign in to comment.