File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
test/SourceKit/CodeFormat Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -366,7 +366,8 @@ class FormatContext {
366
366
Expr *AtExprEnd = End.getAsExpr ();
367
367
if (AtExprEnd && (isa<ClosureExpr>(AtExprEnd) ||
368
368
isa<ParenExpr>(AtExprEnd) ||
369
- isa<TupleExpr>(AtExprEnd))) {
369
+ isa<TupleExpr>(AtExprEnd) ||
370
+ isa<CaptureListExpr>(AtExprEnd))) {
370
371
371
372
if (auto *Paren = dyn_cast_or_null<ParenExpr>(Cursor->getAsExpr ())) {
372
373
auto *SubExpr = Paren->getSubExpr ();
Original file line number Diff line number Diff line change @@ -32,6 +32,16 @@ func foo4() {
32
32
} ( )
33
33
}
34
34
35
+ func foo5( input: Int , block: ( Int ) -> ( ) ) -> Int {
36
+ return 0
37
+ }
38
+
39
+ func foo6( ) {
40
+ _ = foo5 ( input: 0 , block: { [ unowned self] blockInput in
41
+ foo4 ( )
42
+ } )
43
+ }
44
+
35
45
// RUN: %sourcekitd-test -req=format -line=3 -length=1 %s >%t.response
36
46
// RUN: %sourcekitd-test -req=format -line=4 -length=1 %s >>%t.response
37
47
// RUN: %sourcekitd-test -req=format -line=5 -length=1 %s >>%t.response
@@ -46,6 +56,7 @@ func foo4() {
46
56
// RUN: %sourcekitd-test -req=format -line=30 -length=1 %s >>%t.response
47
57
// RUN: %sourcekitd-test -req=format -line=31 -length=1 %s >>%t.response
48
58
// RUN: %sourcekitd-test -req=format -line=32 -length=1 %s >>%t.response
59
+ // RUN: %sourcekitd-test -req=format -line=42 -length=1 %s >>%t.response
49
60
// RUN: %FileCheck --strict-whitespace %s <%t.response
50
61
51
62
// CHECK: key.sourcetext: " var abc = 1"
@@ -68,3 +79,5 @@ func foo4() {
68
79
// CHECK: key.sourcetext: " let test = {"
69
80
// CHECK: key.sourcetext: " return 0"
70
81
// CHECK: key.sourcetext: " }()"
82
+
83
+ // CHECK: key.sourcetext: " })"
You can’t perform that action at this time.
0 commit comments