Skip to content

Commit 57294b9

Browse files
committed
use templating, use instance name for plugin
1 parent b392816 commit 57294b9

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CommandGenerator.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,11 @@ private void addCommandSpecificPlugins() {
493493
return;
494494
}
495495
writer.openBlock(", { ", " }", () -> {
496-
writer.writeInline(String.join(", ", additionalParameters));
496+
writer
497+
.pushState()
498+
.putContext("params", additionalParameters)
499+
.writeInline("${#params}${value:L}, ${/params}")
500+
.popState();
497501
clientAddParamsWriterConsumers.forEach((key, consumer) -> {
498502
writer.writeInline("$L: $C,", key, (Consumer<TypeScriptWriter>) (w -> {
499503
consumer.accept(w, CommandConstructorCodeSection.builder()

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServiceBareBonesClientGenerator.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,11 @@ private void generateConstructor() {
460460
}
461461

462462
writer.openBlock(", {", " }", () -> {
463-
writer.writeInline(String.join(", ", additionalParameters));
463+
writer
464+
.pushState()
465+
.putContext("params", additionalParameters)
466+
.writeInline("${#params}${value:L}, ${/params}")
467+
.popState();
464468
clientAddParamsWriterConsumers.forEach((key, consumer) -> {
465469
writer.writeInline("$L: $C,", key, (Consumer<TypeScriptWriter>) (w -> {
466470
consumer.accept(w, ClientBodyExtraCodeSection.builder()

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/AddEventStreamDependency.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public final class AddEventStreamDependency implements TypeScriptIntegration {
4747
@Override
4848
public List<String> runAfter() {
4949
return List.of(
50-
AddBuiltinPlugins.class.getCanonicalName()
50+
new AddBuiltinPlugins().name()
5151
);
5252
}
5353

0 commit comments

Comments
 (0)