Skip to content

Commit 7f5ee10

Browse files
committed
Remove some unnecessary TODOs and unnecessary code
The generator does not produce any .tsx files.
1 parent 5376095 commit 7f5ee10

File tree

4 files changed

+2
-22
lines changed

4 files changed

+2
-22
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ public void customizeBeforeIntegrations(
376376
directive.fileManifest().writeFile(from, getClass(), to);
377377
});
378378

379-
// TODO: do all of these parts below are before/after?
380379
SymbolVisitor.writeModelIndex(directive.connectedShapes().values(), directive.symbolProvider(),
381380
directive.fileManifest());
382381

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
@SmithyInternalApi
3333
final class ImportDeclarations implements ImportContainer {
3434

35-
// TODO: remove this
3635
private final String moduleNameString;
3736
private final Path relativize;
3837
private final Map<String, Pair<String, Ignore>> defaultImports = new TreeMap<>();
@@ -82,7 +81,6 @@ ImportDeclarations addImport(String name, String alias, String module) {
8281

8382
@Override
8483
public void importSymbol(Symbol symbol, String alias) {
85-
// TODO: is this if needed?
8684
if (!symbol.getNamespace().isEmpty() && !symbol.getNamespace().equals(moduleNameString)) {
8785
addImport(symbol.getName(), alias, symbol.getNamespace());
8886
}

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public final class TypeScriptWriter extends SymbolWriter<TypeScriptWriter, Impor
4949

5050
private final boolean withAttribution;
5151

52-
// TODO: see if this can be removed
5352
public TypeScriptWriter(String moduleName) {
5453
this(moduleName, true);
5554
}
@@ -69,10 +68,9 @@ public static final class TypeScriptWriterFactory implements SymbolWriter.Factor
6968

7069
@Override
7170
public TypeScriptWriter apply(String filename, String namespace) {
72-
boolean attribution = filename.endsWith(".ts") || filename.endsWith(".tsx");
73-
// TODO: Attribution accounts for tsx too, but moduleName doesn't.
71+
boolean withAttribution = filename.endsWith(".ts");
7472
String moduleName = filename.endsWith(".ts") ? filename.substring(0, filename.length() - 3) : filename;
75-
return new TypeScriptWriter(moduleName, attribution);
73+
return new TypeScriptWriter(moduleName, withAttribution);
7674
}
7775
}
7876

@@ -97,7 +95,6 @@ public TypeScriptWriter addIgnoredDefaultImport(String name, String from, String
9795
* @param from Module to import the type from.
9896
* @return Returns the writer.
9997
*/
100-
// TODO: see what references of this method call can be changed to use Symbol instead of String name
10198
public TypeScriptWriter addImport(String name, String as, String from) {
10299
getImportContainer().addImport(name, as, from);
103100
return this;

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,6 @@
4141
public interface TypeScriptIntegration
4242
extends SmithyIntegration<TypeScriptSettings, TypeScriptWriter, TypeScriptCodegenContext> {
4343

44-
/**
45-
* Preprocess the model before code generation.
46-
*
47-
* <p>This can be used to remove unsupported features, remove traits
48-
* from shapes (e.g., make members optional), etc.
49-
*
50-
* @param model Model being generated.
51-
* @param settings Setting used to generate.
52-
* @return Returns the updated model.
53-
*/
54-
default Model preprocessModel(Model model, TypeScriptSettings settings) {
55-
return model;
56-
}
57-
5844
/**
5945
* Writes additional files.
6046
*

0 commit comments

Comments
 (0)