-
Notifications
You must be signed in to change notification settings - Fork 122
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
Use a long annotation w/ parameters with trailing commas constructor #558
Comments
Ah, yes. In this case, the annotation and the parameter don't all fit on one line. I had to figure out what to do in this case and there wasn't a lot of hand-formatted prior art in the corpus to go on, so I kind of just picked something that was reasonable to implement. |
Are you just expecting fewer spaces, Matan? |
I mean yeah, I'm expecting it to line up nicely :-/ |
This has been labelled trailing-commas, but it applies without commas as well. The formatter currently outputs code like: void reallyLongFunctionName0(
@Deprecated('This has been deprecated for many interesting reasons...')
arg1) {
return;
}
void fn1(
{@Deprecated('This has been deprecated for many interesting reasons...')
String argument1}) {
return;
} |
Thanks for pointing that out, Sam! |
In the forthcoming tall style, these examples get formatted as: class RouteDefinition {
const factory RouteDefinition.fork(
String path,
List<RouteDefinition> children, {
@Required('When `path` is navigated to, what path within `children` to use')
String defaultTo,
}) = ForkedRouteDefinition._;
} And: void reallyLongFunctionName0(
@Deprecated('This has been deprecated for many interesting reasons...')
arg1,
) {
return;
}
void fn1({
@Deprecated('This has been deprecated for many interesting reasons...')
String argument1,
}) {
return;
} So I think we're good. |
Apologies for the long issue name. The code will make it more clear, me thinks.
Nice, just using
@required
:Also works fine with something like
@Required('I told you so, Bob')
.Less nice, using
@Required(... with a long enough string here...)
:The text was updated successfully, but these errors were encountered: