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

Side by Side Diff: packages/dart_style/test/whitespace/metadata.unit

Issue 2990843002: Removed fixed dependencies (Closed)
Patch Set: Created 3 years, 4 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 unified diff | Download patch
OLDNEW
1 40 columns | 1 40 columns |
2 >>> force newline before directives 2 >>> force newline before directives
3 @deprecated library foo; 3 @deprecated library foo;
4 4
5 @deprecated import 'dart:io'; 5 @deprecated import 'dart:io';
6 6
7 @deprecated export 'dart:io'; 7 @deprecated export 'dart:io';
8 <<< 8 <<<
9 @deprecated 9 @deprecated
10 library foo; 10 library foo;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 @meta 56 @meta
57 var a; 57 var a;
58 58
59 @meta 59 @meta
60 var b; 60 var b;
61 61
62 @a 62 @a
63 @b 63 @b
64 var c; 64 var c;
65 } 65 }
66 >>> allow inline annotations before functions 66 >>> force newline before function
67 @meta foo() {}
68 <<<
69 @meta foo() {} 67 @meta foo() {}
70 >>> allow newline before functions
71 @meta
72
73
74 foo() {}
75 <<< 68 <<<
76 @meta 69 @meta
77 foo() {} 70 foo() {}
78 >>> allow inline annotations before members 71 >>> multiple annotations before function get their own line
72 @meta @another foo() {}
73 <<<
74 @meta
75 @another
76 foo() {}
77 >>> force newline before member
79 class X { 78 class X {
80 @meta var _x; 79 @meta var _x;
81 @meta X.y(); 80 @meta X.y();
82 @meta factory X(x) => null; 81 @meta factory X(x) => null;
83 @meta int x() => null; 82 @meta int x() => null;
84 } 83 }
85 <<< 84 <<<
86 class X { 85 class X {
87 @meta var _x;
88 @meta X.y();
89 @meta factory X(x) => null;
90 @meta int x() => null;
91 }
92 >>> allow newline before members
93 class X {
94 @meta
95
96 var _x;
97
98 @meta
99
100
101
102 X.y();
103
104 @meta
105 factory X(x) => null;
106
107 @meta
108
109 int x() => null;
110 }
111 <<<
112 class X {
113 @meta 86 @meta
114 var _x; 87 var _x;
115
116 @meta 88 @meta
117 X.y(); 89 X.y();
118
119 @meta 90 @meta
120 factory X(x) => null; 91 factory X(x) => null;
121
122 @meta 92 @meta
123 int x() => null; 93 int x() => null;
124 } 94 }
95 >>> multiple annotations before members get own line
96 class X {
97 @meta @another var _x;
98 @meta @another X.y();
99 @meta @another factory X(x) => null;
100 @meta @another int x() => null;
101 }
102 <<<
103 class X {
104 @meta
105 @another
106 var _x;
107 @meta
108 @another
109 X.y();
110 @meta
111 @another
112 factory X(x) => null;
113 @meta
114 @another
115 int x() => null;
116 }
125 >>> collapse newlines between annotations 117 >>> collapse newlines between annotations
126 @a 118 @a
127 119
128 120
129 @b 121 @b
130 122
131 123
132 124
133 @c 125 @c
134 126
135 127
136 class A {} 128 class A {}
137 <<< 129 <<<
138 @a 130 @a
139 @b 131 @b
140 @c 132 @c
141 class A {} 133 class A {}
142 >>> multiple top-level annotations always get their own line 134 >>> multiple top-level annotations always get their own line
143 @a @b class A {} 135 @a @b class A {}
144 <<< 136 <<<
145 @a 137 @a
146 @b 138 @b
147 class A {} 139 class A {}
148 >>> multiple member annotations always get their own line
149 class A {
150 @a @b void foo() {}
151 }
152 <<<
153 class A {
154 @a
155 @b
156 void foo() {}
157 }
158 >>> parameter annotations are inline 140 >>> parameter annotations are inline
159 foo( 141 foo(
160 142
161 @a 143 @a
162 144
163 @b 145 @b
164 146
165 param) {} 147 param) {}
166 <<< 148 <<<
167 foo(@a @b param) {} 149 foo(@a @b param) {}
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 @foo @bar int fn(@foo param)) {} 202 @foo @bar int fn(@foo param)) {}
221 withoutReturnType( 203 withoutReturnType(
222 @foo @bar fn(@foo param)) {} 204 @foo @bar fn(@foo param)) {}
223 >>> metadata on default formal parameter 205 >>> metadata on default formal parameter
224 positional([@foo bar]) {} 206 positional([@foo bar]) {}
225 named({@foo bar}) {} 207 named({@foo bar}) {}
226 <<< 208 <<<
227 positional([@foo bar]) {} 209 positional([@foo bar]) {}
228 named({@foo bar}) {} 210 named({@foo bar}) {}
229 >>> split between metadata and parameter indents 211 >>> split between metadata and parameter indents
230 function(@VeryLongMetadataAnnotation longParameter) {} 212 function(@Annotation @VeryLongMetadataAnnotation longParameter) {}
231 <<< 213 <<<
232 function( 214 function(
215 @Annotation
233 @VeryLongMetadataAnnotation 216 @VeryLongMetadataAnnotation
234 longParameter) {} 217 longParameter) {}
218 >>> unsplit with trailing commas
219 function(@Annotation longParameter,@Annotation @Other longParameter2,) {}
220 <<<
221 function(
222 @Annotation longParameter,
223 @Annotation @Other longParameter2,
224 ) {}
225 >>> split with trailing commas
226 function(@Annotation longParameter,@Annotation @Other @Third longParameter2,) {}
227 <<<
228 function(
229 @Annotation longParameter,
230 @Annotation
231 @Other
232 @Third
233 longParameter2,
234 ) {}
235 >>> keep "covariant" with parameter
236 function(@Annotation @VeryLongMetadataAnnotation covariant longParameter) {}
237 <<<
238 function(
239 @Annotation
240 @VeryLongMetadataAnnotation
241 covariant longParameter) {}
OLDNEW
« no previous file with comments | « packages/dart_style/test/whitespace/functions.unit ('k') | packages/dart_style/test/whitespace/methods.unit » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698