You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
plugin.proto describe the messages to interact with protoc as a plugin but the feature doesn't seem to be fully accessible from C#.
Here are the steps I tried:
Using the file directly: Impossible, C# doesn't support proto2
Using the file converted to proto3: Doesn't work as it tries to reference global::Google.Protobuf.Reflection.FileDescriptorProto that isn't accessible.
Converting descriptor.proto and compiling it too: Descriptor.cs doesn't build as it reference internals that aren't accessible like CustomOptions.Empty (protoc does special generation when it see Descriptor.proto)
Avoid protoc special casing (Changing the folder of descriptor.proto): Now it works and writing a basic plugin is possible. But we lost the magic introduced in Low-level support for custom options in C# #2317 so custom options aren't usable at all (And can't be hacked around as it relies on extensions and they aren't supported).
I don't see any way to make it work with google version of C#/protobuf 😢 but maybe i'm missing something ?
The text was updated successfully, but these errors were encountered:
vbfox
changed the title
Can't create a full compiler plugin in C#
Can't create a full protoc plugin in C#
Aug 14, 2017
plugin.proto describe the messages to interact with
protoc
as a plugin but the feature doesn't seem to be fully accessible from C#.Here are the steps I tried:
Using the file directly: Impossible, C# doesn't support proto2
Using the file converted to proto3: Doesn't work as it tries to reference
global::Google.Protobuf.Reflection.FileDescriptorProto
that isn't accessible.Converting descriptor.proto and compiling it too:
Descriptor.cs
doesn't build as it reference internals that aren't accessible likeCustomOptions.Empty
(protoc does special generation when it see Descriptor.proto)Avoid protoc special casing (Changing the folder of
descriptor.proto
): Now it works and writing a basic plugin is possible. But we lost the magic introduced in Low-level support for custom options in C# #2317 so custom options aren't usable at all (And can't be hacked around as it relies on extensions and they aren't supported).I don't see any way to make it work with google version of C#/protobuf 😢 but maybe i'm missing something ?
The text was updated successfully, but these errors were encountered: