Skip to content

Conversation

@tarrinneal
Copy link
Contributor

@tarrinneal tarrinneal commented Jan 11, 2023

Adds StructuredGenerator class and subclasses

fixes flutter/flutter#117416

Copy link
Member

@gaaclarke gaaclarke left a 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.

@stuartmorgan-g
Copy link
Collaborator

Merge branch 'main' of github.com:flutter/packages into againWithFlair

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.

Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g left a 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.

) {
final Indent indent = Indent(sink);

writeFilePrologue(generatorOptions, root, sink, indent);
Copy link
Collaborator

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.)

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: pigeon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pigeon] Restructure generators to create more consistent structure amongst generator code

3 participants