Skip to content

Commit e6a17e7

Browse files
authored
Enable support for Editions in protoc-gen-grpc-web.
protoc-gen-js now supports Editions. Enable support here by exposing supported version information to protoc too.
1 parent c1c1751 commit e6a17e7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

javascript/net/grpc/web/generator/grpc_generator.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <string>
3131

3232
using google::protobuf::Descriptor;
33+
using google::protobuf::Edition;
3334
using google::protobuf::EnumDescriptor;
3435
using google::protobuf::FieldDescriptor;
3536
using google::protobuf::FileDescriptor;
@@ -1522,9 +1523,12 @@ class GrpcCodeGenerator : public CodeGenerator {
15221523

15231524
uint64_t GetSupportedFeatures() const override {
15241525
// Code generators must explicitly support proto3 optional.
1525-
return CodeGenerator::FEATURE_PROTO3_OPTIONAL;
1526+
return CodeGenerator::FEATURE_PROTO3_OPTIONAL | CodeGenerator::FEATURE_SUPPORTS_EDITIONS;
15261527
}
15271528

1529+
Edition GetMinimumEdition() const override { return Edition::EDITION_PROTO2; }
1530+
Edition GetMaximumEdition() const override { return Edition::EDITION_2023; }
1531+
15281532
bool Generate(const FileDescriptor* file, const string& parameter,
15291533
GeneratorContext* context, string* error) const override {
15301534
GeneratorOptions generator_options;

0 commit comments

Comments
 (0)