-
Notifications
You must be signed in to change notification settings - Fork 130
Refactor handling of generateDocs:false #4095
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
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.
Overall looks good, will take another pass tonight.
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.
Love it! Definitely simpler!
I have a couple of nits, I will add it in a follow-up PR. Also, I was thinking of a slightly different design, where we might want to keep the |
set generator(Generator newGenerator) => _generator = newGenerator; | ||
|
||
/// Factory method that builds Dartdoc with an empty generator. | ||
factory Dartdoc.withEmptyGenerator( |
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.
FYI, the dart
tool is using this in its implementation of dart doc
; see https://github.com/dart-lang/sdk/blob/main/pkg/dartdev/lib/src/commands/doc.dart#L119.
I'm sure its possible to update the tool for this change, but we'll want to do that as part of the next roll of this repo into the sdk.
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.
Thanks! I was unaware of that. I'll make a migration CL...
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.
Gotcha; tracking the work here so we don't lose track: #4100
Not sure if anyone is using this option really. But I think the handling can be simplified.
But it seems that having multiple Generator classes just for deciding whether to write files or not is excessive, and likely to get out of sync (does the EmptyGenerator really still do whatever GeneratorFrontend does, just without writing files?)