File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
test/SourceKit/CodeFormat Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -289,6 +289,15 @@ class FormatContext {
289
289
isKeywordPossibleDeclStart (*TInfo.StartOfLineBeforeTarget ) &&
290
290
TInfo.StartOfLineBeforeTarget ->isKeyword ())
291
291
return false ;
292
+ // VStack {
293
+ // ...
294
+ // }
295
+ // .onAppear { <---- No indentation here.
296
+ if (TInfo.StartOfLineTarget ->getKind () == tok::period &&
297
+ TInfo.StartOfLineBeforeTarget ->getKind () == tok::r_brace &&
298
+ TInfo.StartOfLineBeforeTarget + 1 == TInfo.StartOfLineTarget ) {
299
+ return false ;
300
+ }
292
301
}
293
302
294
303
// Handle switch / case, indent unless at a case label.
Original file line number Diff line number Diff line change @@ -67,6 +67,13 @@ func foo10() {
67
67
] . whatever
68
68
}
69
69
70
+ func foo11( ) {
71
+ VStack {
72
+ }
73
+ . onAppear {
74
+ }
75
+ }
76
+
70
77
// RUN: %sourcekitd-test -req=format -line=3 -length=1 %s >%t.response
71
78
// RUN: %sourcekitd-test -req=format -line=4 -length=1 %s >>%t.response
72
79
// RUN: %sourcekitd-test -req=format -line=5 -length=1 %s >>%t.response
@@ -96,6 +103,7 @@ func foo10() {
96
103
97
104
// RUN: %sourcekitd-test -req=format -line=66 -length=1 %s >>%t.response
98
105
// RUN: %sourcekitd-test -req=format -line=67 -length=1 %s >>%t.response
106
+ // RUN: %sourcekitd-test -req=format -line=73 -length=1 %s >>%t.response
99
107
100
108
// RUN: %FileCheck --strict-whitespace %s <%t.response
101
109
@@ -136,3 +144,4 @@ func foo10() {
136
144
137
145
// CHECK: key.sourcetext: " Something() ["
138
146
// CHECK: key.sourcetext: " ].whatever"
147
+ // CHECK: key.sourcetext: " .onAppear {"
You can’t perform that action at this time.
0 commit comments