Enable Editions in the C# generator.

PiperOrigin-RevId: 611508658
pull/16007/head
Protobuf Team Bot 1 year ago committed by Copybara-Service
parent 8958768d3c
commit 421040b32b
  1. 3
      src/google/protobuf/compiler/csharp/csharp_generator.cc
  2. 2
      src/google/protobuf/compiler/csharp/csharp_generator.h

@ -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,

@ -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;
};

Loading…
Cancel
Save