Generting imports for external enums in TS (#5175)

This commit is contained in:
Kamil Rojewski 2019-02-14 22:08:55 +01:00 committed by Wouter van Oortmerssen
parent a66a88034a
commit 224f7527e3
1 changed files with 6 additions and 2 deletions

View File

@ -763,6 +763,10 @@ class JsTsGenerator : public BaseGenerator {
GenPrefixedTypeName(GenTypeName(field.value.type, false, true), GenPrefixedTypeName(GenTypeName(field.value.type, false, true),
field.value.type.enum_def->file) + field.value.type.enum_def->file) +
" {\n"; " {\n";
if (!parser_.opts.generate_all) {
imported_files.insert(field.value.type.enum_def->file);
}
} else { } else {
code += "):" + GenTypeName(field.value.type, false, true) + " {\n"; code += "):" + GenTypeName(field.value.type, false, true) + " {\n";
} }