Partially revert 692f026: Emit related types within wrapper namespace

There are a lot of internal users depending on the old behavior of the
libclang-based generator.

PiperOrigin-RevId: 432281224
Change-Id: If82333fc3001f52de59e57a874f28bf8815d0877
This commit is contained in:
Christian Blichmann 2022-03-03 14:14:02 -08:00 committed by Copybara-Service
parent 1cf2d840dd
commit eec22e8aaf

View File

@ -331,6 +331,12 @@ absl::StatusOr<std::string> EmitHeader(
absl::StrAppendFormat(&out, kEmbedInclude, include_file);
}
// If specified, wrap the generated API in a namespace
if (options.has_namespace()) {
absl::StrAppendFormat(&out, kNamespaceBeginTemplate,
options.namespace_name);
}
// Emit type dependencies
if (!rendered_types.empty()) {
absl::StrAppend(&out, "// Types this API depends on\n");
@ -347,12 +353,6 @@ absl::StatusOr<std::string> EmitHeader(
}
}
// If specified, wrap the generated API in a namespace
if (options.has_namespace()) {
absl::StrAppendFormat(&out, kNamespaceBeginTemplate,
options.namespace_name);
}
// Optionally emit a default sandbox that instantiates an embedded sandboxee
if (!options.embed_name.empty()) {
// TODO(cblichmann): Make the "Sandbox" suffix configurable.