Skip to content

Commit

Permalink
Enable Editions in the C# generator.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 611508658
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Feb 29, 2024
1 parent 8958768 commit 421040b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/google/protobuf/compiler/csharp/csharp_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 28,8 @@ Generator::Generator() {}
Generator::~Generator() {}

uint64_t Generator::GetSupportedFeatures() const {
return CodeGenerator::Feature::FEATURE_PROTO3_OPTIONAL;
return CodeGenerator::Feature::FEATURE_PROTO3_OPTIONAL |
CodeGenerator::Feature::FEATURE_SUPPORTS_EDITIONS;
}

void GenerateFile(const FileDescriptor* file, io::Printer* printer,
Expand Down
2 changes: 2 additions & 0 deletions src/google/protobuf/compiler/csharp/csharp_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 35,8 @@ class PROTOC_EXPORT Generator : public CodeGenerator {
GeneratorContext* generator_context,
std::string* error) const override;
uint64_t GetSupportedFeatures() const override;
Edition GetMinimumEdition() const override { return Edition::EDITION_PROTO2; }
Edition GetMaximumEdition() const override { return Edition::EDITION_2023; }
using CodeGenerator::GetEdition;
};

Expand Down

0 comments on commit 421040b

Please sign in to comment.