File tree Expand file tree Collapse file tree 3 files changed +34
-4
lines changed Expand file tree Collapse file tree 3 files changed +34
-4
lines changed Original file line number Diff line number Diff line change @@ -775,7 +775,8 @@ mixin PieceFactory {
775
775
pieces.token (catchKeyword);
776
776
pieces.space ();
777
777
778
- var parameters = DelimitedListBuilder (this );
778
+ var parameters = DelimitedListBuilder (
779
+ this , const ListStyle (commas: Commas .nonTrailing));
779
780
parameters.leftBracket (catchClause.leftParenthesis! );
780
781
if (catchClause.exceptionParameter case var exceptionParameter? ) {
781
782
parameters.visit (exceptionParameter);
Original file line number Diff line number Diff line change @@ -110,4 +110,33 @@ try {
110
110
} on FooException {
111
111
} on BarException {
112
112
doSomething();
113
- }
113
+ }
114
+ >>> Split inside catch clause without stack trace.
115
+ try {
116
+ doSomething();
117
+ } catch (someSurprisinglyLongVariableName) {
118
+ doSomething();
119
+ }
120
+ <<<
121
+ try {
122
+ doSomething();
123
+ } catch (
124
+ someSurprisinglyLongVariableName
125
+ ) {
126
+ doSomething();
127
+ }
128
+ >>> Split inside catch clause with stack trace.
129
+ try {
130
+ doSomething();
131
+ } catch (longErrorVariable, longStackTrace) {
132
+ doSomething();
133
+ }
134
+ <<<
135
+ try {
136
+ doSomething();
137
+ } catch (
138
+ longErrorVariable,
139
+ longStackTrace
140
+ ) {
141
+ doSomething();
142
+ }
Original file line number Diff line number Diff line change 27
27
body;
28
28
} catch (
29
29
// comment
30
- e,
30
+ e
31
31
) {
32
32
print(e);
33
33
}
@@ -38,7 +38,7 @@ try { body; } catch (e// comment
38
38
try {
39
39
body;
40
40
} catch (
41
- e, // comment
41
+ e // comment
42
42
) {
43
43
print(e);
44
44
}
You can’t perform that action at this time.
0 commit comments