jhump / protoreflect

Reflection (Rich Descriptors) for Go Protocol Buffers
Apache License 2.0
1.35k stars 172 forks source link

Use proto v2 for rendering options in output #531

Closed marcoferrer closed 1 year ago

marcoferrer commented 2 years ago

The current proto text printer outputs options using <> to denote the open and close of a message literal. The newer proto printer in the V2 API uses {} which is the most common convention used in public examples.

https://github.com/grpc-ecosystem/grpc-gateway/blob/master/examples/internal/proto/examplepb/a_bit_of_everything.proto

PR with proposed changes https://github.com/jhump/protoreflect/pull/530

jhump commented 1 year ago

The formatting is much improved in #354. This does not actually use the proto v2 package for rendering but instead uses a custom renderer for message literals that can respect the line breaking configuration of the printer.