File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 43
43
final class TypeScriptWriter extends CodeWriter {
44
44
45
45
private final Path moduleName ;
46
+ private final String moduleNameString ;
46
47
private final ImportDeclarations imports ;
47
48
48
49
TypeScriptWriter (String moduleName ) {
49
50
this .moduleName = Paths .get (moduleName );
51
+ moduleNameString = moduleName ;
50
52
imports = new ImportDeclarations (moduleName );
51
53
52
54
setIndentText (" " );
@@ -63,7 +65,9 @@ final class TypeScriptWriter extends CodeWriter {
63
65
*/
64
66
TypeScriptWriter addImport (Symbol symbol ) {
65
67
if (!symbol .getNamespace ().isEmpty ()) {
66
- addImport (symbol .getName (), symbol .getName (), symbol .getNamespace ());
68
+ if (!symbol .getNamespace ().equals (moduleNameString )) {
69
+ addImport (symbol .getName (), symbol .getName (), symbol .getNamespace ());
70
+ }
67
71
for (SymbolReference reference : symbol .getReferences ()) {
68
72
addImport (reference );
69
73
}
You can’t perform that action at this time.
0 commit comments