mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-01 11:51:38 +00:00
Not generating imports/ns prefixes with --gen-all (#4644)
* Eclipse ignore * TypeScript support * Prefixing enums * Test results * Merged JS and TS generators * Fixed AppVeyor build problems * Fixed more AppVeyor build problems * Fixed more AppVeyor build problems * Changed TS flag to options struct * Storing options by value * Removed unneeded const * Re-export support for unions * Uint support * Casting bools to numbers for mutation * TS shell tests * Reverted generates js test file to original version * Backing up js tests and properly generating test data * Not importing flatbuffers for TS test generation * Not overwriting generated js for tests * AppVeyor test fixes * Generating the most strict TS code possible * Not returning null when creating vectors * Not returning null from struct contructors * Vector of unions for ts/js * Sanity check for languages * Indentation fix + output test files * Vectors of unions for php * Fixes to union vector handling + tests * Fix for strictPropertyInitialization * Fix for new aligned operator new for gcc >= 7.1 * Not generating imports/ns prefixes with --gen-all
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
55ddb84eb2
commit
48d8232584
@@ -469,7 +469,7 @@ class JsGenerator : public BaseGenerator {
|
|||||||
const std::string &file) {
|
const std::string &file) {
|
||||||
const auto basename =
|
const auto basename =
|
||||||
flatbuffers::StripPath(flatbuffers::StripExtension(file));
|
flatbuffers::StripPath(flatbuffers::StripExtension(file));
|
||||||
if (basename == file_name_) { return typeName; }
|
if (basename == file_name_ || parser_.opts.generate_all) { return typeName; }
|
||||||
return GenFileNamespacePrefix(file) + "." + typeName;
|
return GenFileNamespacePrefix(file) + "." + typeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -741,7 +741,7 @@ class JsGenerator : public BaseGenerator {
|
|||||||
code += ", " + GenBBAccess() + ") : null;\n";
|
code += ", " + GenBBAccess() + ") : null;\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lang_.language == IDLOptions::kTs) {
|
if (lang_.language == IDLOptions::kTs && !parser_.opts.generate_all) {
|
||||||
imported_files.insert(field.value.type.struct_def->file);
|
imported_files.insert(field.value.type.struct_def->file);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -787,7 +787,10 @@ class JsGenerator : public BaseGenerator {
|
|||||||
vectortypename = GenPrefixedTypeName(
|
vectortypename = GenPrefixedTypeName(
|
||||||
vectortypename, vectortype.struct_def->file);
|
vectortypename, vectortype.struct_def->file);
|
||||||
code += prefix + ", obj?:" + vectortypename;
|
code += prefix + ", obj?:" + vectortypename;
|
||||||
imported_files.insert(vectortype.struct_def->file);
|
|
||||||
|
if (!parser_.opts.generate_all) {
|
||||||
|
imported_files.insert(vectortype.struct_def->file);
|
||||||
|
}
|
||||||
} else if (vectortype.base_type == BASE_TYPE_STRING) {
|
} else if (vectortype.base_type == BASE_TYPE_STRING) {
|
||||||
code += prefix + "):string\n";
|
code += prefix + "):string\n";
|
||||||
code += prefix + ",optionalEncoding:flatbuffers.Encoding" +
|
code += prefix + ",optionalEncoding:flatbuffers.Encoding" +
|
||||||
|
|||||||
Reference in New Issue
Block a user