Skip to content

Allow right paren of enum case decl to be on the same line as the las… #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ fileprivate final class TokenStreamCreator: SyntaxVisitor {
after(node.trailingComma, tokens: .break)

if let associatedValue = node.associatedValue {
arrangeParameterClause(associatedValue, forcesBreakBeforeRightParen: true)
arrangeParameterClause(associatedValue, forcesBreakBeforeRightParen: false)
}

return .visitChildren
Expand Down
5 changes: 2 additions & 3 deletions Tests/SwiftFormatPrettyPrintTests/EnumDeclTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,14 @@ final class EnumDeclTests: PrettyPrintTestCase {
fifth
case sixth(Int)
case seventh(
a: Int, b: Bool, c: Double
)
a: Int, b: Bool, c: Double)
}

"""

var config = Configuration()
config.lineBreakBeforeEachArgument = false
assertPrettyPrintEqual(input: input, expected: expected, linelength: 30, configuration: config)
assertPrettyPrintEqual(input: input, expected: expected, linelength: 31, configuration: config)
}

func testIndirectEnum() {
Expand Down