-
Notifications
You must be signed in to change notification settings - Fork 875
docs(toh): fix code-example format and Dart code excerpt #2907
docs(toh): fix code-example format and Dart code excerpt #2907
Conversation
@@ -26,7 +26,11 @@ class HeroesComponent implements OnInit { | |||
Hero selectedHero; | |||
|
|||
// #docregion renaming | |||
HeroesComponent(this._heroService, this._router); | |||
HeroesComponent(this._heroService, |
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.
It's OK to terminate an arg list with a ","? (Seems like it should be, but not sure whether all the SDKs the pubspec allows actually support this.)
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.
It's technically OK in TS although misleading. It would read like this:
HeroesComponent(this._heroService,
);
That's pretty awful in all kinds of ways. There should be another way to convey the message.
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.
The trade-off is to enable plaster /* ... */ in the code excerpt, or to leave it as is. IMHO, even if a particular SDK doesn't support it, readers should understand that the code excerpt is suggestive, given that the heading is "lib/heroes_component.dart (showing renamings only)". Use of plaster just makes it too cluttered.
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.
@wardbell - btw, this is only for the Dart code excerpt.
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.
Btw, I was trying to avoid having a heroes_component_1.dart
file (which would be another way of solving this).
How does the second commit change the visible formatting? Also, does webdev handle this OK? |
Yes, webdev can handle all these changes (and uses all those formatings already). |
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.
Good enough for now.
In the Dart toh-5: ensure
HeroesComponent
doc regionrenaming
doesn't show a router.