Skip to content

Commit 98f458f

Browse files
authored
Merge pull request swiftlang#176 from dylansturg/enums
Allow right paren of enum case decl to be on the same line as the las…
2 parents a32359c + 558e190 commit 98f458f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ fileprivate final class TokenStreamCreator: SyntaxVisitor {
11901190
after(node.trailingComma, tokens: .break)
11911191

11921192
if let associatedValue = node.associatedValue {
1193-
arrangeParameterClause(associatedValue, forcesBreakBeforeRightParen: true)
1193+
arrangeParameterClause(associatedValue, forcesBreakBeforeRightParen: false)
11941194
}
11951195

11961196
return .visitChildren

Tests/SwiftFormatPrettyPrintTests/EnumDeclTests.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,14 @@ final class EnumDeclTests: PrettyPrintTestCase {
115115
fifth
116116
case sixth(Int)
117117
case seventh(
118-
a: Int, b: Bool, c: Double
119-
)
118+
a: Int, b: Bool, c: Double)
120119
}
121120
122121
"""
123122

124123
var config = Configuration()
125124
config.lineBreakBeforeEachArgument = false
126-
assertPrettyPrintEqual(input: input, expected: expected, linelength: 30, configuration: config)
125+
assertPrettyPrintEqual(input: input, expected: expected, linelength: 31, configuration: config)
127126
}
128127

129128
func testIndirectEnum() {

0 commit comments

Comments
 (0)