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

Unified Diff: packages/dart_style/test/whitespace/metadata.unit

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/whitespace/if.stmt ('k') | packages/dart_style/test/whitespace/methods.unit » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..393218076f2605e44b658a3666a959b872ca6bdb
--- /dev/null
+++ b/packages/dart_style/test/whitespace/metadata.unit
@@ -0,0 +1,218 @@
+40 columns |
+>>> force newline before directives
+@deprecated library foo;
+
+@deprecated import 'dart:io';
+
+@deprecated export 'dart:io';
+<<<
+@deprecated
+library foo;
+
+@deprecated
+import 'dart:io';
+
+@deprecated
+export 'dart:io';
+>>> force newline before types
+@meta class X {}
+
+@meta class Y = X with Z;
+
+@meta typedef void X(y);
+<<<
+@meta
+class X {}
+
+@meta
+class Y = X with Z;
+
+@meta
+typedef void X(y);
+>>> force newline before variable declarations
+foo() {
+ @meta var a;
+
+ @meta
+ var b;
+
+ @a @b
+
+
+ var c;
+}
+<<<
+foo() {
+ @meta
+ var a;
+
+ @meta
+ var b;
+
+ @a
+ @b
+ var c;
+}
+>>> allow inline annotations before functions
+@meta foo() {}
+<<<
+@meta foo() {}
+>>> allow newline before functions
+@meta
+
+
+foo() {}
+<<<
+@meta
+foo() {}
+>>> allow inline annotations before members
+class X {
+ @meta var _x;
+ @meta X.y();
+ @meta factory X(x) => null;
+ @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;
+}
+<<<
+class X {
+ @meta
+ var _x;
+
+ @meta
+ X.y();
+
+ @meta
+ factory X(x) => null;
+
+ @meta
+ int x() => null;
+}
+>>> collapse newlines between annotations
+@a
+
+
+@b
+
+
+
+@c
+
+
+class A {}
+<<<
+@a
+@b
+@c
+class A {}
+>>> multiple top-level annotations always get their own line
+@a @b 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(
+
+@a
+
+@b
+
+param) {}
+<<<
+foo(@a @b param) {}
+>>> type parameter annotations are inline
+class Foo<
+
+@a
+
+@b
+
+T> {}
+<<<
+class Foo<@a @b T> {}
+>>> comment after metadata
+@DomName('DatabaseCallback')
+@Experimental() // deprecated
+typedef void DatabaseCallback(database);
+<<<
+@DomName('DatabaseCallback')
+@Experimental() // deprecated
+typedef void DatabaseCallback(database);
+>>> comment between metadata
+@DomName('DatabaseCallback') // deprecated
+ @Experimental()
+ typedef void DatabaseCallback(database);
+<<<
+@DomName(
+ 'DatabaseCallback') // deprecated
+@Experimental()
+typedef void DatabaseCallback(database);
+>>> metadata on top-level variables
+@DomName('DatabaseCallback')
+@Experimental()
+var variable;
+<<<
+@DomName('DatabaseCallback')
+@Experimental()
+var variable;
+>>> metadata on parameters
+main(@foo @bar param) {}
+<<<
+main(@foo @bar param) {}
+>>> metadata on initializing formal
+class Foo {
+ Foo(@bar this.field);
+}
+<<<
+class Foo {
+ Foo(@bar this.field);
+}
+>>> metadata on function-typed formal parameter
+withReturnType(@foo @bar int fn(@foo param)) {}
+withoutReturnType(@foo @bar fn(@foo param)) {}
+<<<
+withReturnType(
+ @foo @bar int fn(@foo param)) {}
+withoutReturnType(
+ @foo @bar fn(@foo param)) {}
+>>> metadata on default formal parameter
+positional([@foo bar]) {}
+named({@foo bar}) {}
+<<<
+positional([@foo bar]) {}
+named({@foo bar}) {}
« no previous file with comments | « packages/dart_style/test/whitespace/if.stmt ('k') | packages/dart_style/test/whitespace/methods.unit » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698