Skip to content

Commit

Permalink
Editions: Include defaults for any features in the generated pool.
Browse files Browse the repository at this point in the history
This helps make the API more complete, since the FeatureSet object will always be fully resolved on any accessible features.  This specifically targets C++ plugins though, which will now have their features filled in by default.  Before, any proto files that didn't include the language-specific features would result in unresolved extensions in the generators.

PiperOrigin-RevId: 557232654
  • Loading branch information
mkruskal-google authored and copybara-github committed Aug 15, 2023
1 parent f57b3ee commit 15863ff
Show file tree
Hide file tree
Showing 9 changed files with 452 additions and 127 deletions.
1 change: 0 additions & 1 deletion src/google/protobuf/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,6 @@ filegroup(
"unittest_features.proto",
"unittest_import.proto",
"unittest_import_public.proto",
"unittest_invalid_features.proto",
"unittest_lite_imports_nonlite.proto",
"unittest_mset.proto",
"unittest_mset_wire_format.proto",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1564,6 +1564,10 @@ TEST_F(CommandLineInterfaceTest, Plugin_RuntimeFeatures) {
message_encoding: LENGTH_PREFIXED
json_format: ALLOW
raw_features { field_presence: IMPLICIT }
[pb.cpp] {
legacy_closed_enum: false
utf8_validation: VERIFY_PARSE
}
)pb"));
EXPECT_THAT(request.source_file_descriptors(0)
.message_type(0)
Expand All @@ -1577,6 +1581,10 @@ TEST_F(CommandLineInterfaceTest, Plugin_RuntimeFeatures) {
message_encoding: LENGTH_PREFIXED
json_format: ALLOW
raw_features { field_presence: IMPLICIT }
[pb.cpp] {
legacy_closed_enum: false
utf8_validation: VERIFY_PARSE
}
)pb"));
}

Expand Down
Loading

0 comments on commit 15863ff

Please sign in to comment.