diff --git a/Sources/SwiftBasicFormat/BasicFormat.swift b/Sources/SwiftBasicFormat/BasicFormat.swift index 3b277e42d5b..30c4e55c9d9 100644 --- a/Sources/SwiftBasicFormat/BasicFormat.swift +++ b/Sources/SwiftBasicFormat/BasicFormat.swift @@ -334,6 +334,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 5a11a387663..7dd65b7cc2b 100644 --- a/Tests/SwiftBasicFormatTest/BasicFormatTests.swift +++ b/Tests/SwiftBasicFormatTest/BasicFormatTests.swift @@ -531,4 +531,11 @@ final class BasicFormatTest: XCTestCase { ) } } + + func testRightAnglePeriodNotFormatted() { + assertFormatted( + tree: ExprSyntax("Foo.bar"), + expected: "Foo.bar" + ) + } }