From a3a35de5bb599635eea0d1b7094ed5a4b4058d6c Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Wed, 15 Feb 2023 13:20:01 -0800 Subject: [PATCH 1/2] Move base `RustSymbolProvider` types out of `SymbolVisitor` --- .../codegen/core/smithy/RustSymbolProvider.kt | 70 +++++++++++++++++++ .../core/smithy/SymbolMetadataProvider.kt | 15 ---- .../rust/codegen/core/smithy/SymbolVisitor.kt | 41 ----------- 3 files changed, 70 insertions(+), 56 deletions(-) create mode 100644 codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/RustSymbolProvider.kt diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/RustSymbolProvider.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/RustSymbolProvider.kt new file mode 100644 index 00000000000..b3887fe3c75 --- /dev/null +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/RustSymbolProvider.kt @@ -0,0 +1,70 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package software.amazon.smithy.rust.codegen.core.smithy + +import software.amazon.smithy.codegen.core.Symbol +import software.amazon.smithy.codegen.core.SymbolProvider +import software.amazon.smithy.model.knowledge.NullableIndex +import software.amazon.smithy.model.shapes.MemberShape +import software.amazon.smithy.model.shapes.OperationShape +import software.amazon.smithy.model.shapes.Shape +import software.amazon.smithy.model.shapes.UnionShape +import software.amazon.smithy.model.traits.EnumDefinition +import software.amazon.smithy.rust.codegen.core.rustlang.RustModule + +/** + * SymbolProvider interface that carries both the inner configuration and a function to produce an enum variant name. + */ +interface RustSymbolProvider : SymbolProvider, ModuleProvider { + fun config(): SymbolVisitorConfig + fun toEnumVariantName(definition: EnumDefinition): MaybeRenamed? + + override fun moduleForShape(shape: Shape): RustModule.LeafModule = config().moduleProvider.moduleForShape(shape) + override fun moduleForOperationError(operation: OperationShape): RustModule.LeafModule = + config().moduleProvider.moduleForOperationError(operation) + override fun moduleForEventStreamError(eventStream: UnionShape): RustModule.LeafModule = + config().moduleProvider.moduleForEventStreamError(eventStream) + + /** Returns the symbol for an operation error */ + fun symbolForOperationError(operation: OperationShape): Symbol + + /** Returns the symbol for an event stream error */ + fun symbolForEventStreamError(eventStream: UnionShape): Symbol +} + +/** + * Provider for RustModules so that the symbol provider knows where to organize things. + */ +interface ModuleProvider { + /** Returns the module for a shape */ + fun moduleForShape(shape: Shape): RustModule.LeafModule + + /** Returns the module for an operation error */ + fun moduleForOperationError(operation: OperationShape): RustModule.LeafModule + + /** Returns the module for an event stream error */ + fun moduleForEventStreamError(eventStream: UnionShape): RustModule.LeafModule +} + +data class SymbolVisitorConfig( + val runtimeConfig: RuntimeConfig, + val renameExceptions: Boolean, + val nullabilityCheckMode: NullableIndex.CheckMode, + val moduleProvider: ModuleProvider, +) + +/** + * Default delegator to enable easily decorating another symbol provider. + */ +open class WrappingSymbolProvider(private val base: RustSymbolProvider) : RustSymbolProvider { + override fun config(): SymbolVisitorConfig = base.config() + override fun toEnumVariantName(definition: EnumDefinition): MaybeRenamed? = base.toEnumVariantName(definition) + override fun toSymbol(shape: Shape): Symbol = base.toSymbol(shape) + override fun toMemberName(shape: MemberShape): String = base.toMemberName(shape) + override fun symbolForOperationError(operation: OperationShape): Symbol = base.symbolForOperationError(operation) + override fun symbolForEventStreamError(eventStream: UnionShape): Symbol = + base.symbolForEventStreamError(eventStream) +} diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/SymbolMetadataProvider.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/SymbolMetadataProvider.kt index a1faf8702cf..276e7017ce1 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/SymbolMetadataProvider.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/SymbolMetadataProvider.kt @@ -14,12 +14,10 @@ import software.amazon.smithy.model.shapes.ListShape import software.amazon.smithy.model.shapes.MapShape import software.amazon.smithy.model.shapes.MemberShape import software.amazon.smithy.model.shapes.NumberShape -import software.amazon.smithy.model.shapes.OperationShape import software.amazon.smithy.model.shapes.Shape import software.amazon.smithy.model.shapes.StringShape import software.amazon.smithy.model.shapes.StructureShape import software.amazon.smithy.model.shapes.UnionShape -import software.amazon.smithy.model.traits.EnumDefinition import software.amazon.smithy.model.traits.EnumTrait import software.amazon.smithy.model.traits.SensitiveTrait import software.amazon.smithy.model.traits.StreamingTrait @@ -28,19 +26,6 @@ import software.amazon.smithy.rust.codegen.core.rustlang.RustMetadata import software.amazon.smithy.rust.codegen.core.rustlang.Visibility import software.amazon.smithy.rust.codegen.core.util.hasTrait -/** - * Default delegator to enable easily decorating another symbol provider. - */ -open class WrappingSymbolProvider(private val base: RustSymbolProvider) : RustSymbolProvider { - override fun config(): SymbolVisitorConfig = base.config() - override fun toEnumVariantName(definition: EnumDefinition): MaybeRenamed? = base.toEnumVariantName(definition) - override fun toSymbol(shape: Shape): Symbol = base.toSymbol(shape) - override fun toMemberName(shape: MemberShape): String = base.toMemberName(shape) - override fun symbolForOperationError(operation: OperationShape): Symbol = base.symbolForOperationError(operation) - override fun symbolForEventStreamError(eventStream: UnionShape): Symbol = - base.symbolForEventStreamError(eventStream) -} - /** * Attach `meta` to symbols. `meta` is used by the generators (e.g. StructureGenerator) to configure the generated models. * diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/SymbolVisitor.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/SymbolVisitor.kt index 21c09ac6939..2354c0357ec 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/SymbolVisitor.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/SymbolVisitor.kt @@ -65,27 +65,6 @@ val SimpleShapes: Map, RustType> = mapOf( StringShape::class to RustType.String, ) -/** - * Provider for RustModules so that the symbol provider knows where to organize things. - */ -interface ModuleProvider { - /** Returns the module for a shape */ - fun moduleForShape(shape: Shape): RustModule.LeafModule - - /** Returns the module for an operation error */ - fun moduleForOperationError(operation: OperationShape): RustModule.LeafModule - - /** Returns the module for an event stream error */ - fun moduleForEventStreamError(eventStream: UnionShape): RustModule.LeafModule -} - -data class SymbolVisitorConfig( - val runtimeConfig: RuntimeConfig, - val renameExceptions: Boolean, - val nullabilityCheckMode: CheckMode, - val moduleProvider: ModuleProvider, -) - /** * Make the Rust type of a symbol optional (hold `Option`) * @@ -174,26 +153,6 @@ fun Symbol.Builder.locatedIn(rustModule: RustModule.LeafModule): Symbol.Builder */ data class MaybeRenamed(val name: String, val renamedFrom: String?) -/** - * SymbolProvider interface that carries both the inner configuration and a function to produce an enum variant name. - */ -interface RustSymbolProvider : SymbolProvider, ModuleProvider { - fun config(): SymbolVisitorConfig - fun toEnumVariantName(definition: EnumDefinition): MaybeRenamed? - - override fun moduleForShape(shape: Shape): RustModule.LeafModule = config().moduleProvider.moduleForShape(shape) - override fun moduleForOperationError(operation: OperationShape): RustModule.LeafModule = - config().moduleProvider.moduleForOperationError(operation) - override fun moduleForEventStreamError(eventStream: UnionShape): RustModule.LeafModule = - config().moduleProvider.moduleForEventStreamError(eventStream) - - /** Returns the symbol for an operation error */ - fun symbolForOperationError(operation: OperationShape): Symbol - - /** Returns the symbol for an event stream error */ - fun symbolForEventStreamError(eventStream: UnionShape): Symbol -} - /** * Make the return [value] optional if the [member] symbol is as well optional. */ From 0f1822ffedbc0fa38c6fb97935c2f76119a09f13 Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Wed, 15 Feb 2023 13:23:16 -0800 Subject: [PATCH 2/2] Rename `SymbolVisitorConfig` to `RustSymbolProviderConfig` --- .../codegen/client/smithy/ClientCodegenVisitor.kt | 6 +++--- .../codegen/client/smithy/RustClientCodegenPlugin.kt | 8 ++++---- .../rust/codegen/client/testutil/TestHelpers.kt | 6 +++--- .../client/smithy/EventStreamSymbolProviderTest.kt | 6 +++--- .../rust/codegen/core/smithy/RustSymbolProvider.kt | 9 ++++++--- .../smithy/rust/codegen/core/smithy/SymbolVisitor.kt | 4 ++-- .../smithy/rust/codegen/core/testutil/TestHelpers.kt | 6 +++--- .../codegen/core/rustlang/RustReservedWordsTest.kt | 4 ++-- .../core/smithy/generators/BuilderGeneratorTest.kt | 4 ++-- .../python/smithy/PythonServerCodegenVisitor.kt | 12 ++++++------ .../python/smithy/PythonServerSymbolProvider.kt | 4 ++-- .../python/smithy/RustServerCodegenPythonPlugin.kt | 8 ++++---- .../generators/PythonServerSymbolProviderTest.kt | 6 +++--- .../codegen/server/smithy/RustServerCodegenPlugin.kt | 8 ++++---- .../codegen/server/smithy/ServerCodegenVisitor.kt | 6 +++--- .../codegen/server/smithy/ServerSymbolProviders.kt | 12 ++++++------ .../server/smithy/testutil/ServerTestHelpers.kt | 8 ++++---- 17 files changed, 60 insertions(+), 57 deletions(-) diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt index 6a20ba0073c..401868bcfec 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/ClientCodegenVisitor.kt @@ -31,7 +31,7 @@ import software.amazon.smithy.rust.codegen.core.rustlang.implBlock import software.amazon.smithy.rust.codegen.core.smithy.DirectedWalker import software.amazon.smithy.rust.codegen.core.smithy.RustCrate import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProvider -import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitorConfig +import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProviderConfig import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.StructureGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.UnionGenerator @@ -67,7 +67,7 @@ class ClientCodegenVisitor( private val protocolGenerator: ClientProtocolGenerator init { - val symbolVisitorConfig = SymbolVisitorConfig( + val rustSymbolProviderConfig = RustSymbolProviderConfig( runtimeConfig = settings.runtimeConfig, renameExceptions = settings.codegenConfig.renameExceptions, nullabilityCheckMode = NullableIndex.CheckMode.CLIENT_ZERO_VALUE_V1, @@ -82,7 +82,7 @@ class ClientCodegenVisitor( model = codegenDecorator.transformModel(untransformedService, baseModel) // the model transformer _might_ change the service shape val service = settings.getService(model) - symbolProvider = RustClientCodegenPlugin.baseSymbolProvider(model, service, symbolVisitorConfig) + symbolProvider = RustClientCodegenPlugin.baseSymbolProvider(model, service, rustSymbolProviderConfig) codegenContext = ClientCodegenContext(model, symbolProvider, service, protocol, settings, codegenDecorator) diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/RustClientCodegenPlugin.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/RustClientCodegenPlugin.kt index aa94e25b77f..a48ac81f162 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/RustClientCodegenPlugin.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/RustClientCodegenPlugin.kt @@ -22,10 +22,10 @@ import software.amazon.smithy.rust.codegen.core.rustlang.RustReservedWordSymbolP import software.amazon.smithy.rust.codegen.core.smithy.BaseSymbolMetadataProvider import software.amazon.smithy.rust.codegen.core.smithy.CodegenTarget import software.amazon.smithy.rust.codegen.core.smithy.EventStreamSymbolProvider +import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProviderConfig import software.amazon.smithy.rust.codegen.core.smithy.StreamingShapeMetadataProvider import software.amazon.smithy.rust.codegen.core.smithy.StreamingShapeSymbolProvider import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitor -import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitorConfig import java.util.logging.Level import java.util.logging.Logger @@ -72,10 +72,10 @@ class RustClientCodegenPlugin : ClientDecoratableBuildPlugin() { * The Symbol provider is composed of a base [SymbolVisitor] which handles the core functionality, then is layered * with other symbol providers, documented inline, to handle the full scope of Smithy types. */ - fun baseSymbolProvider(model: Model, serviceShape: ServiceShape, symbolVisitorConfig: SymbolVisitorConfig) = - SymbolVisitor(model, serviceShape = serviceShape, config = symbolVisitorConfig) + fun baseSymbolProvider(model: Model, serviceShape: ServiceShape, rustSymbolProviderConfig: RustSymbolProviderConfig) = + SymbolVisitor(model, serviceShape = serviceShape, config = rustSymbolProviderConfig) // Generate different types for EventStream shapes (e.g. transcribe streaming) - .let { EventStreamSymbolProvider(symbolVisitorConfig.runtimeConfig, it, model, CodegenTarget.CLIENT) } + .let { EventStreamSymbolProvider(rustSymbolProviderConfig.runtimeConfig, it, model, CodegenTarget.CLIENT) } // Generate `ByteStream` instead of `Blob` for streaming binary shapes (e.g. S3 GetObject) .let { StreamingShapeSymbolProvider(it, model) } // Add Rust attributes (like `#[derive(PartialEq)]`) to generated shapes diff --git a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/testutil/TestHelpers.kt b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/testutil/TestHelpers.kt index d82e7b93c43..ce0034841c9 100644 --- a/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/testutil/TestHelpers.kt +++ b/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/testutil/TestHelpers.kt @@ -19,7 +19,7 @@ import software.amazon.smithy.rust.codegen.core.smithy.CodegenTarget import software.amazon.smithy.rust.codegen.core.smithy.CoreRustSettings import software.amazon.smithy.rust.codegen.core.smithy.RuntimeConfig import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProvider -import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitorConfig +import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProviderConfig import software.amazon.smithy.rust.codegen.core.testutil.TestRuntimeConfig import software.amazon.smithy.rust.codegen.core.testutil.testRustSettings @@ -49,7 +49,7 @@ fun clientTestRustSettings( customizationConfig, ) -val ClientTestSymbolVisitorConfig = SymbolVisitorConfig( +val ClientTestRustSymbolProviderConfig = RustSymbolProviderConfig( runtimeConfig = TestRuntimeConfig, renameExceptions = true, nullabilityCheckMode = NullableIndex.CheckMode.CLIENT_ZERO_VALUE_V1, @@ -60,7 +60,7 @@ fun testSymbolProvider(model: Model, serviceShape: ServiceShape? = null): RustSy RustClientCodegenPlugin.baseSymbolProvider( model, serviceShape ?: ServiceShape.builder().version("test").id("test#Service").build(), - ClientTestSymbolVisitorConfig, + ClientTestRustSymbolProviderConfig, ) fun testCodegenContext( diff --git a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/EventStreamSymbolProviderTest.kt b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/EventStreamSymbolProviderTest.kt index c7dd8efc70a..d26cee721fd 100644 --- a/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/EventStreamSymbolProviderTest.kt +++ b/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/EventStreamSymbolProviderTest.kt @@ -10,7 +10,7 @@ import org.junit.jupiter.api.Test import software.amazon.smithy.model.shapes.MemberShape import software.amazon.smithy.model.shapes.ServiceShape import software.amazon.smithy.model.shapes.ShapeId -import software.amazon.smithy.rust.codegen.client.testutil.ClientTestSymbolVisitorConfig +import software.amazon.smithy.rust.codegen.client.testutil.ClientTestRustSymbolProviderConfig import software.amazon.smithy.rust.codegen.core.rustlang.RustType import software.amazon.smithy.rust.codegen.core.smithy.CodegenTarget import software.amazon.smithy.rust.codegen.core.smithy.EventStreamSymbolProvider @@ -46,7 +46,7 @@ class EventStreamSymbolProviderTest { ) val service = model.expectShape(ShapeId.from("test#TestService")) as ServiceShape - val provider = EventStreamSymbolProvider(TestRuntimeConfig, SymbolVisitor(model, service, ClientTestSymbolVisitorConfig), model, CodegenTarget.CLIENT) + val provider = EventStreamSymbolProvider(TestRuntimeConfig, SymbolVisitor(model, service, ClientTestRustSymbolProviderConfig), model, CodegenTarget.CLIENT) // Look up the synthetic input/output rather than the original input/output val inputStream = model.expectShape(ShapeId.from("test.synthetic#TestOperationInput\$inputStream")) as MemberShape @@ -82,7 +82,7 @@ class EventStreamSymbolProviderTest { ) val service = model.expectShape(ShapeId.from("test#TestService")) as ServiceShape - val provider = EventStreamSymbolProvider(TestRuntimeConfig, SymbolVisitor(model, service, ClientTestSymbolVisitorConfig), model, CodegenTarget.CLIENT) + val provider = EventStreamSymbolProvider(TestRuntimeConfig, SymbolVisitor(model, service, ClientTestRustSymbolProviderConfig), model, CodegenTarget.CLIENT) // Look up the synthetic input/output rather than the original input/output val inputStream = model.expectShape(ShapeId.from("test.synthetic#TestOperationInput\$inputStream")) as MemberShape diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/RustSymbolProvider.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/RustSymbolProvider.kt index b3887fe3c75..7b8b115d766 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/RustSymbolProvider.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/RustSymbolProvider.kt @@ -19,7 +19,7 @@ import software.amazon.smithy.rust.codegen.core.rustlang.RustModule * SymbolProvider interface that carries both the inner configuration and a function to produce an enum variant name. */ interface RustSymbolProvider : SymbolProvider, ModuleProvider { - fun config(): SymbolVisitorConfig + fun config(): RustSymbolProviderConfig fun toEnumVariantName(definition: EnumDefinition): MaybeRenamed? override fun moduleForShape(shape: Shape): RustModule.LeafModule = config().moduleProvider.moduleForShape(shape) @@ -49,7 +49,10 @@ interface ModuleProvider { fun moduleForEventStreamError(eventStream: UnionShape): RustModule.LeafModule } -data class SymbolVisitorConfig( +/** + * Configuration for symbol providers. + */ +data class RustSymbolProviderConfig( val runtimeConfig: RuntimeConfig, val renameExceptions: Boolean, val nullabilityCheckMode: NullableIndex.CheckMode, @@ -60,7 +63,7 @@ data class SymbolVisitorConfig( * Default delegator to enable easily decorating another symbol provider. */ open class WrappingSymbolProvider(private val base: RustSymbolProvider) : RustSymbolProvider { - override fun config(): SymbolVisitorConfig = base.config() + override fun config(): RustSymbolProviderConfig = base.config() override fun toEnumVariantName(definition: EnumDefinition): MaybeRenamed? = base.toEnumVariantName(definition) override fun toSymbol(shape: Shape): Symbol = base.toSymbol(shape) override fun toMemberName(shape: MemberShape): String = base.toMemberName(shape) diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/SymbolVisitor.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/SymbolVisitor.kt index 2354c0357ec..8b17879d906 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/SymbolVisitor.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/SymbolVisitor.kt @@ -185,11 +185,11 @@ fun Shape.contextName(serviceShape: ServiceShape?): String { open class SymbolVisitor( private val model: Model, private val serviceShape: ServiceShape?, - private val config: SymbolVisitorConfig, + private val config: RustSymbolProviderConfig, ) : RustSymbolProvider, ShapeVisitor { private val nullableIndex = NullableIndex.of(model) - override fun config(): SymbolVisitorConfig = config + override fun config(): RustSymbolProviderConfig = config override fun toSymbol(shape: Shape): Symbol { return shape.accept(this) diff --git a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/TestHelpers.kt b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/TestHelpers.kt index 2e808656408..023f30236eb 100644 --- a/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/TestHelpers.kt +++ b/codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/testutil/TestHelpers.kt @@ -28,8 +28,8 @@ import software.amazon.smithy.rust.codegen.core.smithy.ModuleProvider import software.amazon.smithy.rust.codegen.core.smithy.RuntimeConfig import software.amazon.smithy.rust.codegen.core.smithy.RuntimeCrateLocation import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProvider +import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProviderConfig import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitor -import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitorConfig import software.amazon.smithy.rust.codegen.core.smithy.generators.BuilderGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.StructureGenerator import software.amazon.smithy.rust.codegen.core.smithy.traits.SyntheticInputTrait @@ -74,7 +74,7 @@ private object CodegenCoreTestModules { } } -val TestSymbolVisitorConfig = SymbolVisitorConfig( +val TestRustSymbolProviderConfig = RustSymbolProviderConfig( runtimeConfig = TestRuntimeConfig, renameExceptions = true, nullabilityCheckMode = NullableIndex.CheckMode.CLIENT_ZERO_VALUE_V1, @@ -116,7 +116,7 @@ fun String.asSmithyModel(sourceLocation: String? = null, smithyVersion: String = internal fun testSymbolProvider(model: Model): RustSymbolProvider = SymbolVisitor( model, ServiceShape.builder().version("test").id("test#Service").build(), - TestSymbolVisitorConfig, + TestRustSymbolProviderConfig, ).let { BaseSymbolMetadataProvider(it, model, additionalAttributes = listOf(Attribute.NonExhaustive)) } .let { RustReservedWordSymbolProvider(it, model) } diff --git a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustReservedWordsTest.kt b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustReservedWordsTest.kt index 9ef10a5af89..ebdf9cdc47f 100644 --- a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustReservedWordsTest.kt +++ b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/rustlang/RustReservedWordsTest.kt @@ -15,7 +15,7 @@ import software.amazon.smithy.model.shapes.UnionShape import software.amazon.smithy.model.traits.EnumDefinition import software.amazon.smithy.rust.codegen.core.smithy.MaybeRenamed import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProvider -import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitorConfig +import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProviderConfig import software.amazon.smithy.rust.codegen.core.testutil.asSmithyModel import software.amazon.smithy.rust.codegen.core.util.PANIC import software.amazon.smithy.rust.codegen.core.util.orNull @@ -23,7 +23,7 @@ import software.amazon.smithy.rust.codegen.core.util.toPascalCase internal class RustReservedWordSymbolProviderTest { class Stub : RustSymbolProvider { - override fun config(): SymbolVisitorConfig = PANIC() + override fun config(): RustSymbolProviderConfig = PANIC() override fun symbolForOperationError(operation: OperationShape): Symbol = PANIC() override fun symbolForEventStreamError(eventStream: UnionShape): Symbol = PANIC() diff --git a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/BuilderGeneratorTest.kt b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/BuilderGeneratorTest.kt index e1ae567571e..5fb91663ef2 100644 --- a/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/BuilderGeneratorTest.kt +++ b/codegen-core/src/test/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/BuilderGeneratorTest.kt @@ -18,7 +18,7 @@ import software.amazon.smithy.rust.codegen.core.rustlang.rust import software.amazon.smithy.rust.codegen.core.smithy.Default import software.amazon.smithy.rust.codegen.core.smithy.MaybeRenamed import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProvider -import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitorConfig +import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProviderConfig import software.amazon.smithy.rust.codegen.core.smithy.setDefault import software.amazon.smithy.rust.codegen.core.testutil.TestWorkspace import software.amazon.smithy.rust.codegen.core.testutil.compileAndTest @@ -66,7 +66,7 @@ internal class BuilderGeneratorTest { val baseProvider = testSymbolProvider(StructureGeneratorTest.model) val provider = object : RustSymbolProvider { - override fun config(): SymbolVisitorConfig { + override fun config(): RustSymbolProviderConfig { return baseProvider.config() } diff --git a/codegen-server/python/src/main/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/PythonServerCodegenVisitor.kt b/codegen-server/python/src/main/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/PythonServerCodegenVisitor.kt index 445ef1ccf2f..5eac72cf3d8 100644 --- a/codegen-server/python/src/main/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/PythonServerCodegenVisitor.kt +++ b/codegen-server/python/src/main/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/PythonServerCodegenVisitor.kt @@ -20,7 +20,7 @@ import software.amazon.smithy.model.traits.ErrorTrait import software.amazon.smithy.rust.codegen.core.rustlang.RustModule import software.amazon.smithy.rust.codegen.core.smithy.CodegenTarget import software.amazon.smithy.rust.codegen.core.smithy.RustCrate -import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitorConfig +import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProviderConfig import software.amazon.smithy.rust.codegen.core.smithy.generators.error.ErrorImplGenerator import software.amazon.smithy.rust.codegen.core.util.getTrait import software.amazon.smithy.rust.codegen.server.python.smithy.generators.PythonServerEnumGenerator @@ -48,8 +48,8 @@ class PythonServerCodegenVisitor( ) : ServerCodegenVisitor(context, codegenDecorator) { init { - val symbolVisitorConfig = - SymbolVisitorConfig( + val rustSymbolProviderConfig = + RustSymbolProviderConfig( runtimeConfig = settings.runtimeConfig, renameExceptions = false, nullabilityCheckMode = NullableIndex.CheckMode.SERVER, @@ -76,14 +76,14 @@ class PythonServerCodegenVisitor( fun baseSymbolProviderFactory( model: Model, serviceShape: ServiceShape, - symbolVisitorConfig: SymbolVisitorConfig, + rustSymbolProviderConfig: RustSymbolProviderConfig, publicConstrainedTypes: Boolean, - ) = RustServerCodegenPythonPlugin.baseSymbolProvider(model, serviceShape, symbolVisitorConfig, publicConstrainedTypes) + ) = RustServerCodegenPythonPlugin.baseSymbolProvider(model, serviceShape, rustSymbolProviderConfig, publicConstrainedTypes) val serverSymbolProviders = ServerSymbolProviders.from( model, service, - symbolVisitorConfig, + rustSymbolProviderConfig, settings.codegenConfig.publicConstrainedTypes, ::baseSymbolProviderFactory, ) diff --git a/codegen-server/python/src/main/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/PythonServerSymbolProvider.kt b/codegen-server/python/src/main/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/PythonServerSymbolProvider.kt index ca750bbb5ca..e8974f46bcf 100644 --- a/codegen-server/python/src/main/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/PythonServerSymbolProvider.kt +++ b/codegen-server/python/src/main/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/PythonServerSymbolProvider.kt @@ -22,9 +22,9 @@ import software.amazon.smithy.model.shapes.UnionShape import software.amazon.smithy.rust.codegen.core.rustlang.RustMetadata import software.amazon.smithy.rust.codegen.core.smithy.RuntimeType import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProvider +import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProviderConfig import software.amazon.smithy.rust.codegen.core.smithy.SymbolMetadataProvider import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitor -import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitorConfig import software.amazon.smithy.rust.codegen.core.smithy.expectRustMetadata import software.amazon.smithy.rust.codegen.core.smithy.traits.SyntheticInputTrait import software.amazon.smithy.rust.codegen.core.smithy.traits.SyntheticOutputTrait @@ -46,7 +46,7 @@ import software.amazon.smithy.rust.codegen.core.util.isStreaming class PythonServerSymbolVisitor( private val model: Model, serviceShape: ServiceShape?, - config: SymbolVisitorConfig, + config: RustSymbolProviderConfig, ) : SymbolVisitor(model, serviceShape, config) { private val runtimeConfig = config().runtimeConfig diff --git a/codegen-server/python/src/main/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/RustServerCodegenPythonPlugin.kt b/codegen-server/python/src/main/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/RustServerCodegenPythonPlugin.kt index 19e3e0dba2c..ad74d9c6a91 100644 --- a/codegen-server/python/src/main/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/RustServerCodegenPythonPlugin.kt +++ b/codegen-server/python/src/main/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/RustServerCodegenPythonPlugin.kt @@ -14,7 +14,7 @@ import software.amazon.smithy.rust.codegen.core.rustlang.RustReservedWordSymbolP import software.amazon.smithy.rust.codegen.core.smithy.BaseSymbolMetadataProvider import software.amazon.smithy.rust.codegen.core.smithy.CodegenTarget import software.amazon.smithy.rust.codegen.core.smithy.EventStreamSymbolProvider -import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitorConfig +import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProviderConfig import software.amazon.smithy.rust.codegen.server.python.smithy.customizations.DECORATORS import software.amazon.smithy.rust.codegen.server.smithy.ConstrainedShapeSymbolMetadataProvider import software.amazon.smithy.rust.codegen.server.smithy.ConstrainedShapeSymbolProvider @@ -70,18 +70,18 @@ class RustServerCodegenPythonPlugin : SmithyBuildPlugin { fun baseSymbolProvider( model: Model, serviceShape: ServiceShape, - symbolVisitorConfig: SymbolVisitorConfig, + rustSymbolProviderConfig: RustSymbolProviderConfig, constrainedTypes: Boolean = true, ) = // Rename a set of symbols that do not implement `PyClass` and have been wrapped in // `aws_smithy_http_server_python::types`. - PythonServerSymbolVisitor(model, serviceShape = serviceShape, config = symbolVisitorConfig) + PythonServerSymbolVisitor(model, serviceShape = serviceShape, config = rustSymbolProviderConfig) // Generate public constrained types for directly constrained shapes. // In the Python server project, this is only done to generate constrained types for simple shapes (e.g. // a `string` shape with the `length` trait), but these always remain `pub(crate)`. .let { if (constrainedTypes) ConstrainedShapeSymbolProvider(it, model, serviceShape) else it } // Generate different types for EventStream shapes (e.g. transcribe streaming) - .let { EventStreamSymbolProvider(symbolVisitorConfig.runtimeConfig, it, model, CodegenTarget.SERVER) } + .let { EventStreamSymbolProvider(rustSymbolProviderConfig.runtimeConfig, it, model, CodegenTarget.SERVER) } // Add Rust attributes (like `#[derive(PartialEq)]`) to generated shapes .let { BaseSymbolMetadataProvider(it, model, additionalAttributes = listOf()) } // Constrained shapes generate newtypes that need the same derives we place on types generated from aggregate shapes. diff --git a/codegen-server/python/src/test/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/generators/PythonServerSymbolProviderTest.kt b/codegen-server/python/src/test/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/generators/PythonServerSymbolProviderTest.kt index 96439ac7870..92f89bf5e65 100644 --- a/codegen-server/python/src/test/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/generators/PythonServerSymbolProviderTest.kt +++ b/codegen-server/python/src/test/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/generators/PythonServerSymbolProviderTest.kt @@ -12,7 +12,7 @@ import software.amazon.smithy.rust.codegen.core.rustlang.RustType import software.amazon.smithy.rust.codegen.core.smithy.rustType import software.amazon.smithy.rust.codegen.core.testutil.asSmithyModel import software.amazon.smithy.rust.codegen.server.python.smithy.PythonServerSymbolVisitor -import software.amazon.smithy.rust.codegen.server.smithy.testutil.ServerTestSymbolVisitorConfig +import software.amazon.smithy.rust.codegen.server.smithy.testutil.ServerTestRustSymbolProviderConfig internal class PythonServerSymbolProviderTest { private val pythonBlobType = RustType.Opaque("Blob", "aws_smithy_http_server_python::types") @@ -45,7 +45,7 @@ internal class PythonServerSymbolProviderTest { value: Timestamp } """.asSmithyModel() - val provider = PythonServerSymbolVisitor(model, null, ServerTestSymbolVisitorConfig) + val provider = PythonServerSymbolVisitor(model, null, ServerTestRustSymbolProviderConfig) // Struct test val timestamp = provider.toSymbol(model.expectShape(ShapeId.from("test#TimestampStruct\$inner"))).rustType() @@ -95,7 +95,7 @@ internal class PythonServerSymbolProviderTest { value: Blob } """.asSmithyModel() - val provider = PythonServerSymbolVisitor(model, null, ServerTestSymbolVisitorConfig) + val provider = PythonServerSymbolVisitor(model, null, ServerTestRustSymbolProviderConfig) // Struct test val blob = provider.toSymbol(model.expectShape(ShapeId.from("test#BlobStruct\$inner"))).rustType() diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/RustServerCodegenPlugin.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/RustServerCodegenPlugin.kt index 812bc50916e..1f38cdd2f4f 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/RustServerCodegenPlugin.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/RustServerCodegenPlugin.kt @@ -13,10 +13,10 @@ import software.amazon.smithy.rust.codegen.core.rustlang.RustReservedWordSymbolP import software.amazon.smithy.rust.codegen.core.smithy.BaseSymbolMetadataProvider import software.amazon.smithy.rust.codegen.core.smithy.CodegenTarget import software.amazon.smithy.rust.codegen.core.smithy.EventStreamSymbolProvider +import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProviderConfig import software.amazon.smithy.rust.codegen.core.smithy.StreamingShapeMetadataProvider import software.amazon.smithy.rust.codegen.core.smithy.StreamingShapeSymbolProvider import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitor -import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitorConfig import software.amazon.smithy.rust.codegen.server.smithy.customizations.CustomValidationExceptionWithReasonDecorator import software.amazon.smithy.rust.codegen.server.smithy.customizations.ServerRequiredCustomizations import software.amazon.smithy.rust.codegen.server.smithy.customizations.SmithyValidationExceptionDecorator @@ -65,14 +65,14 @@ class RustServerCodegenPlugin : ServerDecoratableBuildPlugin() { fun baseSymbolProvider( model: Model, serviceShape: ServiceShape, - symbolVisitorConfig: SymbolVisitorConfig, + rustSymbolProviderConfig: RustSymbolProviderConfig, constrainedTypes: Boolean = true, ) = - SymbolVisitor(model, serviceShape = serviceShape, config = symbolVisitorConfig) + SymbolVisitor(model, serviceShape = serviceShape, config = rustSymbolProviderConfig) // Generate public constrained types for directly constrained shapes. .let { if (constrainedTypes) ConstrainedShapeSymbolProvider(it, model, serviceShape) else it } // Generate different types for EventStream shapes (e.g. transcribe streaming) - .let { EventStreamSymbolProvider(symbolVisitorConfig.runtimeConfig, it, model, CodegenTarget.SERVER) } + .let { EventStreamSymbolProvider(rustSymbolProviderConfig.runtimeConfig, it, model, CodegenTarget.SERVER) } // Generate [ByteStream] instead of `Blob` for streaming binary shapes (e.g. S3 GetObject) .let { StreamingShapeSymbolProvider(it, model) } // Add Rust attributes (like `#[derive(PartialEq)]`) to generated shapes diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/ServerCodegenVisitor.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/ServerCodegenVisitor.kt index 7243b1fa6cb..1216b6a7bb6 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/ServerCodegenVisitor.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/ServerCodegenVisitor.kt @@ -36,7 +36,7 @@ import software.amazon.smithy.rust.codegen.core.smithy.CodegenTarget import software.amazon.smithy.rust.codegen.core.smithy.CoreRustSettings import software.amazon.smithy.rust.codegen.core.smithy.DirectedWalker import software.amazon.smithy.rust.codegen.core.smithy.RustCrate -import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitorConfig +import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProviderConfig import software.amazon.smithy.rust.codegen.core.smithy.generators.EnumGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.StructureGenerator import software.amazon.smithy.rust.codegen.core.smithy.generators.UnionGenerator @@ -103,7 +103,7 @@ open class ServerCodegenVisitor( protected var validationExceptionConversionGenerator: ValidationExceptionConversionGenerator init { - val symbolVisitorConfig = SymbolVisitorConfig( + val rustSymbolProviderConfig = RustSymbolProviderConfig( runtimeConfig = settings.runtimeConfig, renameExceptions = false, nullabilityCheckMode = NullableIndex.CheckMode.SERVER, @@ -127,7 +127,7 @@ open class ServerCodegenVisitor( val serverSymbolProviders = ServerSymbolProviders.from( model, service, - symbolVisitorConfig, + rustSymbolProviderConfig, settings.codegenConfig.publicConstrainedTypes, RustServerCodegenPlugin::baseSymbolProvider, ) diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/ServerSymbolProviders.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/ServerSymbolProviders.kt index 0e368d85175..d7161ad1d0d 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/ServerSymbolProviders.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/ServerSymbolProviders.kt @@ -8,7 +8,7 @@ package software.amazon.smithy.rust.codegen.server.smithy import software.amazon.smithy.model.Model import software.amazon.smithy.model.shapes.ServiceShape import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProvider -import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitorConfig +import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProviderConfig /** * Just a handy class to centralize initialization all the symbol providers required by the server code generators, to @@ -26,24 +26,24 @@ class ServerSymbolProviders private constructor( fun from( model: Model, service: ServiceShape, - symbolVisitorConfig: SymbolVisitorConfig, + rustSymbolProviderConfig: RustSymbolProviderConfig, publicConstrainedTypes: Boolean, - baseSymbolProviderFactory: (model: Model, service: ServiceShape, symbolVisitorConfig: SymbolVisitorConfig, publicConstrainedTypes: Boolean) -> RustSymbolProvider, + baseSymbolProviderFactory: (model: Model, service: ServiceShape, rustSymbolProviderConfig: RustSymbolProviderConfig, publicConstrainedTypes: Boolean) -> RustSymbolProvider, ): ServerSymbolProviders { - val baseSymbolProvider = baseSymbolProviderFactory(model, service, symbolVisitorConfig, publicConstrainedTypes) + val baseSymbolProvider = baseSymbolProviderFactory(model, service, rustSymbolProviderConfig, publicConstrainedTypes) return ServerSymbolProviders( symbolProvider = baseSymbolProvider, constrainedShapeSymbolProvider = baseSymbolProviderFactory( model, service, - symbolVisitorConfig, + rustSymbolProviderConfig, true, ), unconstrainedShapeSymbolProvider = UnconstrainedShapeSymbolProvider( baseSymbolProviderFactory( model, service, - symbolVisitorConfig, + rustSymbolProviderConfig, false, ), model, publicConstrainedTypes, service, diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/testutil/ServerTestHelpers.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/testutil/ServerTestHelpers.kt index 69f75f46b5f..d0ca4ed2691 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/testutil/ServerTestHelpers.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/testutil/ServerTestHelpers.kt @@ -15,7 +15,7 @@ import software.amazon.smithy.rust.codegen.core.rustlang.RustWriter import software.amazon.smithy.rust.codegen.core.rustlang.implBlock import software.amazon.smithy.rust.codegen.core.smithy.RuntimeConfig import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProvider -import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitorConfig +import software.amazon.smithy.rust.codegen.core.smithy.RustSymbolProviderConfig import software.amazon.smithy.rust.codegen.core.smithy.generators.StructureGenerator import software.amazon.smithy.rust.codegen.core.testutil.TestRuntimeConfig import software.amazon.smithy.rust.codegen.server.smithy.RustServerCodegenPlugin @@ -28,7 +28,7 @@ import software.amazon.smithy.rust.codegen.server.smithy.customizations.SmithyVa import software.amazon.smithy.rust.codegen.server.smithy.generators.ServerBuilderGenerator // These are the settings we default to if the user does not override them in their `smithy-build.json`. -val ServerTestSymbolVisitorConfig = SymbolVisitorConfig( +val ServerTestRustSymbolProviderConfig = RustSymbolProviderConfig( runtimeConfig = TestRuntimeConfig, renameExceptions = false, nullabilityCheckMode = NullableIndex.CheckMode.SERVER, @@ -49,7 +49,7 @@ fun serverTestSymbolProviders( ServerSymbolProviders.from( model, serviceShape ?: testServiceShapeFor(model), - ServerTestSymbolVisitorConfig, + ServerTestRustSymbolProviderConfig, ( settings ?: serverTestRustSettings( (serviceShape ?: testServiceShapeFor(model)).id, @@ -98,7 +98,7 @@ fun serverTestCodegenContext( val serverSymbolProviders = ServerSymbolProviders.from( model, service, - ServerTestSymbolVisitorConfig, + ServerTestRustSymbolProviderConfig, settings.codegenConfig.publicConstrainedTypes, RustServerCodegenPlugin::baseSymbolProvider, )