I've been using the new options features to add options for C# code
generation - similar to the existing Java options.

Two issues have arisen:
1) (Fairly simple to resolve, probably) - I think it would be worth
creating a repository of "known" extensions for descriptor.proto. For
instance, here's my csharp_options.proto:

import "google/protobuf/descriptor.proto";

package google.protobuf;

option (CSharpNamespace) = "Google.ProtocolBuffers.DescriptorProtos";
option (CSharpUmbrellaClassname) = "CSharpOptions";

extend FileOptions {
  optional string CSharpNamespace = 20000;
  optional string CSharpUmbrellaClassname = 20001;
  optional bool CSharpMultipleFiles = 20002;
  optional bool CSharpNestClasses = 20003;
  optional bool CSharpPublicClasses = 20004;
}

It would be nice if no-one else used 20,000-20,099 (to allow room to
grow). That way different options would be interoperable.

2) (More important.) There's no real reason why anything other than C#
protogen needs to understand these extensions - it would be really
nice if protoc could avoid adding dependencies from the "business"
proto file to descriptor.proto and csharp_options.proto. ProtoGen will
load the descriptor set with the relevant extension registry anyway -
there's no need to actually mention it in the dependency list.

How reasonable would it be to have certain dependencies ignored on
output (i.e. removed from the descriptor set
FileDescriptorProto.dependency list.)

For instance, instead of:

import "google/protobuf/descriptor.proto";
import "google/protobuf/csharp_options.proto";

messages could have:

import transient "google/protobuf/descriptor.proto";
import transient "google/protobuf/csharp_options.proto";

I suspect we'd have to make sure (somehow!) that the dependencies were
only used for extensions but it would solve a definite pain point.

Any thoughts?

Jon


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to