-
Notifications
You must be signed in to change notification settings - Fork 120
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
Special-case decorator-style methods #382
Comments
You're right, @seaneagan, though we also need to tweak the style guide a bit in light of the formatter's more complex handling of nested function arguments. The original style guide rules just produce really nasty output in some cases. Relevant style guide bug: dart-archive/www.dartlang.org#1397 |
nex3
added a commit
that referenced
this issue
Jun 15, 2017
nex3
added a commit
that referenced
this issue
Jun 15, 2017
The forthcoming tall style supports exactly this. You get: Future doThing() => pool.withResource(() {
// ...
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use the following pattern occasionally to simulate decorators; that is, to wrap the body of a method in some block or another to modify its behavior. It avoids extra indentation and looks nice, without being too complex:
Currently, the formatter formats this like so:
It would be nice if it recognized the specific pattern of a
=>
method with a block-format body and indented it like a normal method body.The text was updated successfully, but these errors were encountered: