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

Unified Diff: packages/dart_style/test/splitting/map_arguments.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/loops.stmt ('k') | packages/dart_style/test/splitting/maps.stmt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/dart_style/test/splitting/map_arguments.stmt
diff --git a/packages/dart_style/test/splitting/map_arguments.stmt b/packages/dart_style/test/splitting/map_arguments.stmt
new file mode 100644
index 0000000000000000000000000000000000000000..fb837226571dc7869016cdd6f0d2a9fe585a6bf9
--- /dev/null
+++ b/packages/dart_style/test/splitting/map_arguments.stmt
@@ -0,0 +1,224 @@
+40 columns |
+>>> args before and after map forces nesting
+method(first,{key: value, otherKey: otherLongValue},third);
+<<<
+method(
+ first,
+ {
+ key: value,
+ otherKey: otherLongValue
+ },
+ third);
+>>> nothing but map args does not nest
+longFunctionName({key: value, otherKey: otherLongValue},
+{key: value, otherKey: otherLongValue}, {key: value, otherKey: otherLongValue});
+<<<
+longFunctionName({
+ key: value,
+ otherKey: otherLongValue
+}, {
+ key: value,
+ otherKey: otherLongValue
+}, {
+ key: value,
+ otherKey: otherLongValue
+});
+>>> trailing maps do not nest
+longFunctionName(argument, argument, argument, argument,
+{key: value, otherKey: otherLongValue}, {key: value, otherKey: otherLongValue});
+<<<
+longFunctionName(argument, argument,
+ argument, argument, {
+ key: value,
+ otherKey: otherLongValue
+}, {
+ key: value,
+ otherKey: otherLongValue
+});
+>>> leading maps do not nest
+longFunctionName({key: value, otherKey: otherLongValue},
+{key: value, otherKey: otherLongValue}, argument, argument, argument, argument);
+<<<
+longFunctionName({
+ key: value,
+ otherKey: otherLongValue
+}, {
+ key: value,
+ otherKey: otherLongValue
+}, argument, argument, argument,
+ argument);
+>>> arg between maps forces nesting
+longFunctionName({key: value, otherKey: otherLongValue}, argument,
+{key: value, otherKey: otherLongValue});
+<<<
+longFunctionName(
+ {
+ key: value,
+ otherKey: otherLongValue
+ },
+ argument,
+ {
+ key: value,
+ otherKey: otherLongValue
+ });
+>>> unsplit leading args
+longFunctionName(arg, arg, {key: value, otherKey: otherLongValue});
+<<<
+longFunctionName(arg, arg, {
+ key: value,
+ otherKey: otherLongValue
+});
+>>> split before leading args
+longFunctionName(argument, argument, argument, {key: value, otherKey: otherLongValue});
+<<<
+longFunctionName(
+ argument, argument, argument, {
+ key: value,
+ otherKey: otherLongValue
+});
+>>> split in middle of leading args
+longFunctionName(argument, argument, argument, argument,
+{key: value, otherKey: otherLongValue});
+<<<
+longFunctionName(argument, argument,
+ argument, argument, {
+ key: value,
+ otherKey: otherLongValue
+});
+>>> split before all leading args
+longFunctionName(argument, argument, argument, argument, argument, argument,
+{key: value, otherKey: otherLongValue});
+<<<
+longFunctionName(
+ argument,
+ argument,
+ argument,
+ argument,
+ argument,
+ argument, {
+ key: value,
+ otherKey: otherLongValue
+});
+>>> unsplit trailing args
+longFunctionName({key: value, otherKey: otherLongValue}, argument, argument);
+<<<
+longFunctionName({
+ key: value,
+ otherKey: otherLongValue
+}, argument, argument);
+>>> split before trailing args
+longFunctionName({key: value, otherKey: otherValue} /* very very long comment */,
+argument, argument);
+<<<
+longFunctionName({
+ key: value,
+ otherKey: otherValue
+} /* very very long comment */,
+ argument, argument);
+>>> split in middle of trailing args
+longFunctionName({key: value, otherKey: otherLongValue}, argument, argument, argument, argument);
+<<<
+longFunctionName({
+ key: value,
+ otherKey: otherLongValue
+}, argument, argument, argument,
+ argument);
+>>> split before all trailing args
+longFunctionName({key: value, otherKey: otherLongValue}, argument, argument, argument, argument,
+argument, argument, argument);
+<<<
+longFunctionName({
+ key: value,
+ otherKey: otherLongValue
+},
+ argument,
+ argument,
+ argument,
+ argument,
+ argument,
+ argument,
+ argument);
+>>> don't split leading maps
+longFunctionName({k: v}, {k: v2}, a);
+<<<
+longFunctionName({k: v}, {k: v2}, a);
+>>> split before all args including leading
+longFunctionName({k: v}, {k: v2}, argument);
+<<<
+longFunctionName(
+ {k: v}, {k: v2}, argument);
+>>> split before one leading arg
+longFunctionName({key: value}, {key: value}, argument);
+<<<
+longFunctionName({key: value},
+ {key: value}, argument);
+>>> split before all args including leading
+longFunctionName({k: v}, {key: value}, {key: longerValue}, argument, argument,
+argument, argument, argument, argument, argument);
+<<<
+longFunctionName(
+ {k: v},
+ {key: value},
+ {key: longerValue},
+ argument,
+ argument,
+ argument,
+ argument,
+ argument,
+ argument,
+ argument);
+>>> don't split trailing maps
+longFunctionName(a, {k: v}, {key: va});
+<<<
+longFunctionName(a, {k: v}, {key: va});
+>>> split before all args including trailing
+longFunctionName(argument, {k: v}, {key: va});
+<<<
+longFunctionName(
+ argument, {k: v}, {key: va});
+>>> split before one trailing arg
+longFunctionName(argument, {key: value}, {key: value});
+<<<
+longFunctionName(argument, {key: value},
+ {key: value});
+>>> split before all args including trailing
+longFunctionName(argument, argument, {k: v}, {key: value}, {key: longerValue});
+<<<
+longFunctionName(
+ argument,
+ argument,
+ {k: v},
+ {key: value},
+ {key: longerValue});
+>>> don't nest because of nested 1-arg fn
+outer(inner({key: value, otherKey: otherLongValue}));
+<<<
+outer(inner({
+ key: value,
+ otherKey: otherLongValue
+}));
+>>> do nest because of nested many-arg fn
+outer(argument, inner({key: value, otherKey: otherLongValue}));
+<<<
+outer(
+ argument,
+ inner({
+ key: value,
+ otherKey: otherLongValue
+ }));
+>>> don't nest because of nested 1-arg method call
+obj.outer(obj.inner({key: value, otherKey: otherLongValue}));
+<<<
+obj.outer(obj.inner({
+ key: value,
+ otherKey: otherLongValue
+}));
+>>> do nest because of nested many-arg method call
+obj.outer(argument, obj.inner({key: value, otherKey: otherLongValue}));
+<<<
+obj.outer(
+ argument,
+ obj.inner({
+ key: value,
+ otherKey: otherLongValue
+ }));
« no previous file with comments | « packages/dart_style/test/splitting/loops.stmt ('k') | packages/dart_style/test/splitting/maps.stmt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698