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

Side by Side Diff: pkg/analyzer/test/services/data/wrap_tests.data

Issue 477373002: Improve formatting of variable declarations/assignments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 >>> list literal 1 >>> list literal
2 main() { 2 main() {
3 List<String> values = <String>[a0123456789012345, b0123456789012345, c01234567 89012345, d0123456789012345]; 3 List<String> values = <String>[a0123456789012345, b0123456789012345, c01234567 89012345, d0123456789012345];
4 } 4 }
5 <<< 5 <<<
6 main() { 6 main() {
7 List<String> values = <String>[ 7 List<String> values = <String>[
8 a0123456789012345, 8 a0123456789012345,
9 b0123456789012345, 9 b0123456789012345,
10 c0123456789012345, 10 c0123456789012345,
11 d0123456789012345]; 11 d0123456789012345];
12 } 12 }
13 >>> operators 13 >>> assignment - initializer doesn't fit one line, wrap inside, keep name
14 main() { 14 main() {
15 int result = a0123456789012345 * b0123456789012345 + c0123456789012345 * d0123 456789012345; 15 result = myFunction(a0123456789012345 * b0123456789012345, c0123456789012345 * d0123456789012345);
16 }
17 <<<
18 main() {
19 result = myFunction(
20 a0123456789012345 * b0123456789012345,
21 c0123456789012345 * d0123456789012345);
22 }
23 >>> assignment - initializer fits one line
24 main() {
25 variableLoooooooooooooooong = functionLoooooooooooooooooooooooooooooooooooooon g(1, 2, 3, 4);
26 }
27 <<<
28 main() {
29 variableLoooooooooooooooong =
30 functionLoooooooooooooooooooooooooooooooooooooong(1, 2, 3, 4);
31 }
32 >>> assignment - initializer doesn't fit one line, name too long
33 main() {
34 variableLooooooooooooooooooong = functionLoooooooooooooooooooooooooooooooooooo ng(a0123456789012345 * b0123456789012345, c0123456789012345 * d0123456789012345) ;
35 }
36 <<<
37 main() {
38 variableLooooooooooooooooooong =
39 functionLoooooooooooooooooooooooooooooooooooong(
40 a0123456789012345 * b0123456789012345,
41 c0123456789012345 * d0123456789012345);
42 }
43 >>> variable declaration - initializer doesn't fit one line, wrap inside, keep n ame
44 main() {
45 var result = myFunction(a0123456789012345 * b0123456789012345, c01234567890123 45 * d0123456789012345);
46 }
47 <<<
48 main() {
49 var result = myFunction(
50 a0123456789012345 * b0123456789012345,
51 c0123456789012345 * d0123456789012345);
52 }
53 >>> variable declaration - initializer fits one line
54 main() {
55 var variableLoooooooooooooooong = functionLooooooooooooooooooooooooooooooooooo ong(1, 2, 3, 4);
56 }
57 <<<
58 main() {
59 var variableLoooooooooooooooong =
60 functionLoooooooooooooooooooooooooooooooooooong(1, 2, 3, 4);
61 }
62 >>> variable declaration - initializer doesn't fit one line, name too long
63 main() {
64 var variableLoooooooooooooooong = functionLooooooooooooooooooooooooooooooooooo ong(a0123456789012345 * b0123456789012345, c0123456789012345 * d0123456789012345 );
65 }
66 <<<
67 main() {
68 var variableLoooooooooooooooong =
69 functionLoooooooooooooooooooooooooooooooooooong(
70 a0123456789012345 * b0123456789012345,
71 c0123456789012345 * d0123456789012345);
72 }
73 >>> variable declaration - with binary expression
74 main() {
75 int result = a01234567890123456789 * b01234567890123456789 + c0123456789012345 6789 * d01234567890123456789;
16 } 76 }
17 <<< 77 <<<
18 main() { 78 main() {
19 int result = 79 int result =
20 a0123456789012345 * b0123456789012345 + 80 a01234567890123456789 * b01234567890123456789 +
21 c0123456789012345 * d0123456789012345; 81 c01234567890123456789 * d01234567890123456789;
22 } 82 }
23 >>> arguments 83 >>> arguments
24 main() { 84 main() {
25 myFunction(a0123456789012345 * b0123456789012345, c0123456789012345 * d0123456 789012345); 85 myFunction(a0123456789012345 * b0123456789012345, c0123456789012345 * d0123456 789012345);
26 } 86 }
27 <<< 87 <<<
28 main() { 88 main() {
29 myFunction( 89 myFunction(
30 a0123456789012345 * b0123456789012345, 90 a0123456789012345 * b0123456789012345,
31 c0123456789012345 * d0123456789012345); 91 c0123456789012345 * d0123456789012345);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 main() { 146 main() {
87 MatchKind kind = element != null ? 147 MatchKind kind = element != null ?
88 a012345678901234567890123456789 : 148 a012345678901234567890123456789 :
89 b012345678901234567890123456789; 149 b012345678901234567890123456789;
90 } 150 }
91 >>> expression function body 151 >>> expression function body
92 myFunction() => a012345678901234567890123456789 + b01234567890123456789012345678 9; 152 myFunction() => a012345678901234567890123456789 + b01234567890123456789012345678 9;
93 <<< 153 <<<
94 myFunction() => 154 myFunction() =>
95 a012345678901234567890123456789 + b012345678901234567890123456789; 155 a012345678901234567890123456789 + b012345678901234567890123456789;
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/services/writer.dart ('k') | pkg/analyzer/test/services/formatter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698