-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[pigeon] Adds StructuredGenerator class and subclasses #3037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
gaaclarke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I have a few nits below. I also think the namespace code could have space in the abstract base class and that encode/decode implementations are empty but that could be addressed later if we want.
Sorry I didn't get a chance to do this today; I started but didn't get very far. Hopefully it wasn't too painful to integrate my change. |
stuartmorgan-g
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few small comments, and one larger comment for later consideration, but overall this looks great. Having this coherent structure will be a really big win for maintainability even before we potentially start extracting more shared logic.
I also really, really like having the checked in output files for this kind of PR. Being able to see the (trivial) output changes makes it really easy to have confidence that nothing got accidentally changed in the reorganizing.
packages/pigeon/lib/generator.dart
Outdated
| ) { | ||
| final Indent indent = Indent(sink); | ||
|
|
||
| writeFilePrologue(generatorOptions, root, sink, indent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(At some point I'd like to revisit whether these other things that are passed to literally every method could be instance variables instead, but since they can't be constructor arguments due to the way generate is set up let's have that discussion later so it doesn't block this PR.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to avoid the repeating parameters also
Adds StructuredGenerator class and subclasses
fixes flutter/flutter#117416