File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
compiler/src/java_plugin/cpp Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 2323
2424#include " java_generator.h"
2525#include < google/protobuf/compiler/code_generator.h>
26+ #if GOOGLE_PROTOBUF_VERSION >= 5027000
27+ #include < google/protobuf/compiler/java/java_features.pb.h>
28+ #endif
2629#include < google/protobuf/compiler/plugin.h>
2730#include < google/protobuf/descriptor.h>
2831#include < google/protobuf/io/zero_copy_stream.h>
@@ -57,6 +60,10 @@ class JavaGrpcGenerator : public protobuf::compiler::CodeGenerator {
5760 protobuf::Edition GetMaximumEdition () const override {
5861 return protobuf::Edition::EDITION_2023;
5962 }
63+ std::vector<const protobuf::FieldDescriptor*> GetFeatureExtensions ()
64+ const override {
65+ return {GetExtensionReflection (pb::java)};
66+ }
6067#else
6168 uint64_t GetSupportedFeatures () const override {
6269 return Feature::FEATURE_PROTO3_OPTIONAL;
You can’t perform that action at this time.
0 commit comments