Unverified Commit 88fc7680 authored by Russell Cohen's avatar Russell Cohen Committed by GitHub
Browse files

Fixes for generated docs (#920)

* Fixes for generated doc

- Avoid generating `#Examples` when no examples exist
- Fix typo

* Split out client customizations

* Update changelogs

* Fix generated READMEs
parent ded88181
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
vNext (Month Day, Year)
=======================
**New this week**
- Fix typos in module documentation for generated crates (smithy-rs#920)

**Breaking changes**

+1 −0
Original line number Diff line number Diff line
vNext (Month Day, Year)
=======================
**New this release**
- Fix typos in module documentation for generated crates (smithy-rs#920)

v0.2.0 (December 2nd, 2021)
===========================
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ class AwsReadmeDecorator : RustCodegenDecorator {
                """
                # $moduleName

                **Please Note: The SDK is currently released as an alpha and is intended strictly for
                **Please Note: The SDK is currently in Developer Preview and is intended strictly for
                feedback purposes only. Do not use this SDK for production workloads.**
                """.trimIndent() +
                    "\n\n$description\n\n" +
+6 −0
Original line number Diff line number Diff line
@@ -276,6 +276,12 @@ fun writable(w: Writable): Writable = w

fun writable(w: String): Writable = writable { rust(w) }

fun Writable.isEmpty(): Boolean {
    val writer = RustWriter.root()
    this(writer)
    return writer.toString() == RustWriter.root().toString()
}

class RustWriter private constructor(
    private val filename: String,
    val namespace: String,
+2 −1
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ import software.amazon.smithy.codegen.core.ReservedWordSymbolProvider
import software.amazon.smithy.model.Model
import software.amazon.smithy.model.shapes.ServiceShape
import software.amazon.smithy.rust.codegen.rustlang.RustReservedWordSymbolProvider
import software.amazon.smithy.rust.codegen.smithy.customizations.ClientCustomizations
import software.amazon.smithy.rust.codegen.smithy.customize.CombinedCodegenDecorator
import java.util.logging.Level
import java.util.logging.Logger
@@ -31,7 +32,7 @@ class RustCodegenPlugin : SmithyBuildPlugin {
        // - location (e.g. the mutate section of an operation)
        // - context (e.g. the of the operation)
        // - writer: The active RustWriter at the given location
        val codegenDecorator = CombinedCodegenDecorator.fromClasspath(context)
        val codegenDecorator = CombinedCodegenDecorator.fromClasspath(context, ClientCustomizations())

        // CodegenVisitor is the main driver of code generation that traverses the model and generates code
        CodegenVisitor(context, codegenDecorator).execute()
Loading