Skip to content

Commit 2d5b6bf

Browse files
committed
Rename Rust server codegen plugins
Rename `RustCodegenServerPlugin` to `RustServerCodegenPlugin`, for consistency with `RustClientCodegenPlugin`. This is a better name, since the plugin is named `rust-server-codegen`. This commit also renames `PythonCodegenServerPlugin` to `RustServerCodegenPythonPlugin` for the same reasons. This commit also contains other drive-by improvements made while working on #2302.
1 parent ff8178a commit 2d5b6bf

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

codegen-server/python/src/main/kotlin/software/amazon/smithy/rust/codegen/server/python/smithy/PythonServerCodegenVisitor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class PythonServerCodegenVisitor(
7474
serviceShape: ServiceShape,
7575
symbolVisitorConfig: SymbolVisitorConfig,
7676
publicConstrainedTypes: Boolean,
77-
) = PythonCodegenServerPlugin.baseSymbolProvider(model, serviceShape, symbolVisitorConfig, publicConstrainedTypes)
77+
) = RustServerCodegenPythonPlugin.baseSymbolProvider(model, serviceShape, symbolVisitorConfig, publicConstrainedTypes)
7878

7979
val serverSymbolProviders = ServerSymbolProviders.from(
8080
model,
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import software.amazon.smithy.rust.codegen.core.rustlang.RustReservedWordSymbolP
1414
import software.amazon.smithy.rust.codegen.core.smithy.BaseSymbolMetadataProvider
1515
import software.amazon.smithy.rust.codegen.core.smithy.CodegenTarget
1616
import software.amazon.smithy.rust.codegen.core.smithy.EventStreamSymbolProvider
17-
import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitor
1817
import software.amazon.smithy.rust.codegen.core.smithy.SymbolVisitorConfig
1918
import software.amazon.smithy.rust.codegen.server.python.smithy.customizations.DECORATORS
2019
import software.amazon.smithy.rust.codegen.server.smithy.ConstrainedShapeSymbolMetadataProvider
@@ -26,16 +25,20 @@ import java.util.logging.Level
2625
import java.util.logging.Logger
2726

2827
/**
29-
* Rust with Python bindings Codegen Plugin.
28+
* Rust Server with Python bindings Codegen Plugin.
29+
*
3030
* This is the entrypoint for code generation, triggered by the smithy-build plugin.
3131
* `resources/META-INF.services/software.amazon.smithy.build.SmithyBuildPlugin` refers to this class by name which
3232
* enables the smithy-build plugin to invoke `execute` with all of the Smithy plugin context + models.
3333
*/
34-
class PythonCodegenServerPlugin : SmithyBuildPlugin {
34+
class RustServerCodegenPythonPlugin : SmithyBuildPlugin {
3535
private val logger = Logger.getLogger(javaClass.name)
3636

3737
override fun getName(): String = "rust-server-codegen-python"
3838

39+
/**
40+
* See [software.amazon.smithy.rust.codegen.client.smithy.RustClientCodegenPlugin].
41+
*/
3942
override fun execute(context: PluginContext) {
4043
// Suppress extremely noisy logs about reserved words
4144
Logger.getLogger(ReservedWordSymbolProvider::class.java.name).level = Level.OFF
@@ -57,10 +60,7 @@ class PythonCodegenServerPlugin : SmithyBuildPlugin {
5760

5861
companion object {
5962
/**
60-
* When generating code, smithy types need to be converted into Rust types—that is the core role of the symbol provider
61-
*
62-
* The Symbol provider is composed of a base [SymbolVisitor] which handles the core functionality, then is layered
63-
* with other symbol providers, documented inline, to handle the full scope of Smithy types.
63+
* See [software.amazon.smithy.rust.codegen.client.smithy.RustClientCodegenPlugin].
6464
*/
6565
fun baseSymbolProvider(
6666
model: Model,

codegen-server/python/src/main/resources/META-INF/services/software.amazon.smithy.build.SmithyBuildPlugin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
# SPDX-License-Identifier: Apache-2.0
44
#
5-
software.amazon.smithy.rust.codegen.server.python.smithy.PythonCodegenServerPlugin
5+
software.amazon.smithy.rust.codegen.server.python.smithy.RustServerCodegenPythonPlugin

0 commit comments

Comments
 (0)