File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Sources/SwiftFormatPrettyPrint
Tests/SwiftFormatPrettyPrintTests Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -764,7 +764,9 @@ fileprivate final class TokenStreamCreator: SyntaxVisitor {
764
764
}
765
765
766
766
override func visit( _ node: YieldStmtSyntax ) -> SyntaxVisitorContinueKind {
767
- after ( node. yieldKeyword, tokens: . break)
767
+ // As of https://github.com/apple/swift-syntax/pull/895, the token following a `yield` keyword
768
+ // *must* be on the same line, so we cannot break here.
769
+ after ( node. yieldKeyword, tokens: . space)
768
770
return . visitChildren
769
771
}
770
772
Original file line number Diff line number Diff line change @@ -17,14 +17,12 @@ final class YieldStmtTests: PrettyPrintTestCase {
17
17
"""
18
18
var foo: Int {
19
19
_read {
20
- yield
21
- 1234567890
20
+ yield 1234567890
22
21
}
23
22
_modify {
24
23
var someLongVariable =
25
24
0
26
- yield
27
- &someLongVariable
25
+ yield &someLongVariable
28
26
}
29
27
}
30
28
You can’t perform that action at this time.
0 commit comments