| Index: packages/dart_style/test/whitespace/metadata.unit
|
| diff --git a/packages/dart_style/test/whitespace/metadata.unit b/packages/dart_style/test/whitespace/metadata.unit
|
| index 292e8c865352b8e8c8c9b610fdd38205f5162c49..3d8abb3f7a536618be7ebf11ee9de0b4075faef1 100644
|
| --- a/packages/dart_style/test/whitespace/metadata.unit
|
| +++ b/packages/dart_style/test/whitespace/metadata.unit
|
| @@ -63,19 +63,18 @@ foo() {
|
| @b
|
| var c;
|
| }
|
| ->>> allow inline annotations before functions
|
| -@meta foo() {}
|
| -<<<
|
| +>>> force newline before function
|
| @meta foo() {}
|
| ->>> allow newline before functions
|
| +<<<
|
| @meta
|
| -
|
| -
|
| foo() {}
|
| +>>> multiple annotations before function get their own line
|
| +@meta @another foo() {}
|
| <<<
|
| @meta
|
| +@another
|
| foo() {}
|
| ->>> allow inline annotations before members
|
| +>>> force newline before member
|
| class X {
|
| @meta var _x;
|
| @meta X.y();
|
| @@ -83,43 +82,36 @@ class X {
|
| @meta int x() => null;
|
| }
|
| <<<
|
| -class X {
|
| - @meta var _x;
|
| - @meta X.y();
|
| - @meta factory X(x) => null;
|
| - @meta int x() => null;
|
| -}
|
| ->>> allow newline before members
|
| class X {
|
| @meta
|
| -
|
| var _x;
|
| -
|
| @meta
|
| -
|
| -
|
| -
|
| X.y();
|
| -
|
| @meta
|
| factory X(x) => null;
|
| -
|
| @meta
|
| -
|
| int x() => null;
|
| }
|
| +>>> multiple annotations before members get own line
|
| +class X {
|
| + @meta @another var _x;
|
| + @meta @another X.y();
|
| + @meta @another factory X(x) => null;
|
| + @meta @another int x() => null;
|
| +}
|
| <<<
|
| class X {
|
| @meta
|
| + @another
|
| var _x;
|
| -
|
| @meta
|
| + @another
|
| X.y();
|
| -
|
| @meta
|
| + @another
|
| factory X(x) => null;
|
| -
|
| @meta
|
| + @another
|
| int x() => null;
|
| }
|
| >>> collapse newlines between annotations
|
| @@ -145,16 +137,6 @@ class A {}
|
| @a
|
| @b
|
| class A {}
|
| ->>> multiple member annotations always get their own line
|
| -class A {
|
| - @a @b void foo() {}
|
| -}
|
| -<<<
|
| -class A {
|
| - @a
|
| - @b
|
| - void foo() {}
|
| -}
|
| >>> parameter annotations are inline
|
| foo(
|
|
|
| @@ -227,8 +209,33 @@ named({@foo bar}) {}
|
| positional([@foo bar]) {}
|
| named({@foo bar}) {}
|
| >>> split between metadata and parameter indents
|
| -function(@VeryLongMetadataAnnotation longParameter) {}
|
| +function(@Annotation @VeryLongMetadataAnnotation longParameter) {}
|
| +<<<
|
| +function(
|
| + @Annotation
|
| + @VeryLongMetadataAnnotation
|
| + longParameter) {}
|
| +>>> unsplit with trailing commas
|
| +function(@Annotation longParameter,@Annotation @Other longParameter2,) {}
|
| +<<<
|
| +function(
|
| + @Annotation longParameter,
|
| + @Annotation @Other longParameter2,
|
| +) {}
|
| +>>> split with trailing commas
|
| +function(@Annotation longParameter,@Annotation @Other @Third longParameter2,) {}
|
| +<<<
|
| +function(
|
| + @Annotation longParameter,
|
| + @Annotation
|
| + @Other
|
| + @Third
|
| + longParameter2,
|
| +) {}
|
| +>>> keep "covariant" with parameter
|
| +function(@Annotation @VeryLongMetadataAnnotation covariant longParameter) {}
|
| <<<
|
| function(
|
| + @Annotation
|
| @VeryLongMetadataAnnotation
|
| - longParameter) {}
|
| + covariant longParameter) {}
|
|
|