From 250699cd4f927ad881bd399b44e55cede2d33e05 Mon Sep 17 00:00:00 2001 From: Stephanie DiBenedetto Date: Mon, 11 Aug 2025 10:26:36 -0700 Subject: [PATCH] Do not ignore descriptor extensions Previously, we blanket ignored extensions against the descriptor well known type for historical reasons. We marked this for cleanup in #85; this change follows through on it. --- generator/js_generator.cc | 12 ++---------- jasmine.json | 1 + 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/generator/js_generator.cc b/generator/js_generator.cc index 0098f29d..d6a9e797 100644 --- a/generator/js_generator.cc +++ b/generator/js_generator.cc @@ -430,20 +430,12 @@ std::string GetEnumFileName(const GeneratorOptions& options, // Returns the message/response ID, if set. std::string GetMessageId(const Descriptor* desc) { return std::string(); } -bool IgnoreExtensionField(const FieldDescriptor* field) { - // Exclude descriptor extensions from output "to avoid clutter" (from original - // codegen). - if (!field->is_extension()) return false; - const FileDescriptor* file = field->containing_type()->file(); - return file->name() == "net/proto2/proto/descriptor.proto" || - file->name() == "google/protobuf/descriptor.proto"; -} - // Used inside Google only -- do not remove. bool IsResponse(const Descriptor* desc) { return false; } bool IgnoreField(const FieldDescriptor* field) { - return IgnoreExtensionField(field); + // no-op in open source + return false; } // Do we ignore this message type? diff --git a/jasmine.json b/jasmine.json index aeea72f8..229fd3a6 100644 --- a/jasmine.json +++ b/jasmine.json @@ -11,6 +11,7 @@ "google/protobuf/any.js", "google/protobuf/struct.js", "google/protobuf/timestamp.js", + "google/protobuf/descriptor.js", "testproto_libs1.js", "testproto_libs2.js" ]