Add "CodeGeneratorRequest" access in BuildContext #72
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While this plugin's abstraction of the CodeGeneratorRequest is the main purpose of the plugin, there are times it's necessary to get the original CodeGeneratorRequest that was parsed from stdin.
In regards to the https://github.com/srikrsna/protoc-gen-gotag project
The purpose of this project is to add functionality on top of the "protoc-gen-go" standard plugin by adding tags on to the generated go code. Because the original CodeGeneratorRequest is not available during the module execution, the generated code from the protoc-gen-go plugin must have already been written to disk. This means that you cannot both use the protoc-gen-go plugin and the protoc-gen-gotag plugin in the same execution of protoc. Even worse, if it is not in the current directory of the execution, the module.needs additional parameters to point to the output location.
This could be alleviated by having access to the original CodeGeneratorRequest. If that was available, we could use it to get the CodeGeneratorResponse from the official protoc-gen-go library then enhance it and output the results.
This pull request exposes the original CodeGeneratorRequest as part of the BuildContext