We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c819914 commit 4174e18Copy full SHA for 4174e18
Sources/SwiftBasicFormat/BasicFormat.swift
@@ -237,10 +237,9 @@ open class BasicFormat: SyntaxRewriter {
237
(nil, _):
238
return false
239
case (_, .colon):
240
- let isTernaryExpr = second?.parent?.is(UnresolvedTernaryExprSyntax.self) == true
241
- || second?.parent?.is(TernaryExprSyntax.self) == true
242
-
243
- if !isTernaryExpr {
+ if second?.keyPathInParent != \TernaryExprSyntax.colonMark
+ && second?.keyPathInParent != \UnresolvedTernaryExprSyntax.colonMark
+ {
244
245
}
246
case (.leftAngle, _) where second?.tokenKind != .rightAngle: // `<` and `>` need to be separated by a space because otherwise they become an operator
0 commit comments