Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: packages/dart_style/test/splitting/parameters.stmt

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/dart_style/test/splitting/mixed.stmt ('k') | packages/dart_style/test/splitting/parameters.unit » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/dart_style/test/splitting/parameters.stmt
diff --git a/packages/dart_style/test/splitting/parameters.stmt b/packages/dart_style/test/splitting/parameters.stmt
new file mode 100644
index 0000000000000000000000000000000000000000..25d0b2b8e5047599adf19df40f16b7ff88887a76
--- /dev/null
+++ b/packages/dart_style/test/splitting/parameters.stmt
@@ -0,0 +1,110 @@
+40 columns |
+>>> many parameters
+method(first, second, third, fourth, fifth, sixth, seventh, eighth, ninth,
+ tenth, eleventh, twelfth) {
+ print('42');
+}
+<<<
+method(
+ first,
+ second,
+ third,
+ fourth,
+ fifth,
+ sixth,
+ seventh,
+ eighth,
+ ninth,
+ tenth,
+ eleventh,
+ twelfth) {
+ print('42');
+}
+>>> parameters fit but ) does not
+method(int firstArgument, int argumentTo) {
+ print('42');
+}
+<<<
+method(
+ int firstArgument, int argumentTo) {
+ print('42');
+}
+>>> parameters fit but } does not
+method(int firstArgument, int argument) {
+ print('42');
+}
+<<<
+method(
+ int firstArgument, int argument) {
+ print('42');
+}
+>>> no split after "(" in lambda
+var meth = (
+ int firstArgument, int argumentTo) {
+ print('42');
+};
+<<<
+var meth = (int firstArgument,
+ int argumentTo) {
+ print('42');
+};
+>>> keep mandatory and positional on same line
+foo(param, [foo, bar]) {}
+<<<
+foo(param, [foo, bar]) {}
+>>> keep mandatory and named on same line
+foo(param, {foo, bar}) {}
+<<<
+foo(param, {foo, bar}) {}
+>>> move just optional positional to second line even though all fit on second
+reallyLongMethod(parameter, [foo, bar]) {}
+<<<
+reallyLongMethod(parameter,
+ [foo, bar]) {}
+>>> move just named to second line even though all fit on second
+reallyLongMethod(parameter, {foo, bar}) {}
+<<<
+reallyLongMethod(parameter,
+ {foo, bar}) {}
+>>> avoid splitting in function type parameters
+bool doStuff(parameter1, void printFn(param1, param2)) {}
+<<<
+bool doStuff(parameter1,
+ void printFn(param1, param2)) {}
+>>>
+doStuff(param1, void printFn(param1, param2)) {}
+<<<
+doStuff(param1,
+ void printFn(param1, param2)) {}
+>>> allow splitting in function type parameters
+doStuff(callback(parameter1, parameter2, parameter3, parameter4)) {}
+<<<
+doStuff(callback(parameter1, parameter2,
+ parameter3, parameter4)) {}
+>>> split optional onto one per line if they don't fit on one line
+doStuff([parameter1, parameter2, parameter3]) {}
+<<<
+doStuff(
+ [parameter1,
+ parameter2,
+ parameter3]) {}
+>>> split on positional default value
+doStuff([parameter = veryLongDefaultValueThatSplits, another =
+veryLongDefaultValue, third = alsoQuiteLongDefaultValue]) {}
+<<<
+doStuff(
+ [parameter =
+ veryLongDefaultValueThatSplits,
+ another = veryLongDefaultValue,
+ third =
+ alsoQuiteLongDefaultValue]) {}
+>>> split on named value
+doStuff({parameter: veryLongDefaultValueThatSplits, another:
+veryLongDefaultValue, third: alsoAQuiteLongDefaultValue}) {}
+<<<
+doStuff(
+ {parameter:
+ veryLongDefaultValueThatSplits,
+ another: veryLongDefaultValue,
+ third:
+ alsoAQuiteLongDefaultValue}) {}
« no previous file with comments | « packages/dart_style/test/splitting/mixed.stmt ('k') | packages/dart_style/test/splitting/parameters.unit » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698