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
Referring to generator.go#L1353, it would be much preferred if plugins were asked to supply a list or map of imports and let the generateImports() method take care of ensuring uniqueness, emitting what is needed. As a plugin author I currently need to write intricate checks based on what comes in through the generator.FileDescriptor. Right now, I'm getting an import emitted twice for some proto files, and once on other files.
A breaking change would be to change the signature of GenerateImports(file *generator.FileDescriptor) to return a slice of imports, but I'm guessing that wouldn't be acceptable. So perhaps a better alternative would be to add another interface, which if implemented by the plugin is called instead of GenerateImports.
The text was updated successfully, but these errors were encountered:
The generator is documented as having no compatibility guarantees. Users of the API should vendor the generator.
That being said, the plugin API was primarily designed just for gRPC's use case and falls flat for other use cases and is definitely not considered stable.
A stable and more expressive API would be great, but it's not on the radar for the foreseeable future.
Support for plugins in general needs to be discussed. If we decide to provide first-class support for plugins, there will probably be an entire redesign.
Referring to generator.go#L1353, it would be much preferred if plugins were asked to supply a list or map of imports and let the
generateImports()
method take care of ensuring uniqueness, emitting what is needed. As a plugin author I currently need to write intricate checks based on what comes in through thegenerator.FileDescriptor
. Right now, I'm getting an import emitted twice for some proto files, and once on other files.A breaking change would be to change the signature of
GenerateImports(file *generator.FileDescriptor)
to return a slice of imports, but I'm guessing that wouldn't be acceptable. So perhaps a better alternative would be to add another interface, which if implemented by the plugin is called instead ofGenerateImports
.The text was updated successfully, but these errors were encountered: