diff --git a/Sources/SwiftBasicFormat/BasicFormat.swift b/Sources/SwiftBasicFormat/BasicFormat.swift index 1d7f12fd5c2..dfa7f1ac3da 100644 --- a/Sources/SwiftBasicFormat/BasicFormat.swift +++ b/Sources/SwiftBasicFormat/BasicFormat.swift @@ -310,6 +310,7 @@ open class BasicFormat: SyntaxRewriter { (.regexLiteralPattern, _), (.regexSlash, .regexPoundDelimiter), // closing extended regex delimiter should never be separate by a space (.rightAngle, .leftParen), // func foo(x: T) + (.rightAngle, .period), // Foo.bar (.rightBrace, .leftParen), // { return 1 }() (.rightParen, .leftParen), // returnsClosure()() (.rightParen, .period), // foo().bar diff --git a/Tests/SwiftBasicFormatTest/BasicFormatTests.swift b/Tests/SwiftBasicFormatTest/BasicFormatTests.swift index 1cfd5bb3d4a..e02ea0eaf88 100644 --- a/Tests/SwiftBasicFormatTest/BasicFormatTests.swift +++ b/Tests/SwiftBasicFormatTest/BasicFormatTests.swift @@ -504,4 +504,11 @@ final class BasicFormatTest: XCTestCase { ) } } + + func testRightAnglePeriodNotFormatted() { + assertFormatted( + tree: ExprSyntax("Foo.bar"), + expected: "Foo.bar" + ) + } }