Skip to content

Commit bc48d51

Browse files
authored
Merge pull request #2262 from ahoppen/ahoppen/509/formant-angle-period
[509] Do not add whitespace between right angle and period
2 parents 7420304 + 5bb28eb commit bc48d51

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Sources/SwiftBasicFormat/BasicFormat.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ open class BasicFormat: SyntaxRewriter {
310310
(.regexLiteralPattern, _),
311311
(.regexSlash, .regexPoundDelimiter), // closing extended regex delimiter should never be separate by a space
312312
(.rightAngle, .leftParen), // func foo<T>(x: T)
313+
(.rightAngle, .period), // Foo<T>.bar
313314
(.rightBrace, .leftParen), // { return 1 }()
314315
(.rightParen, .leftParen), // returnsClosure()()
315316
(.rightParen, .period), // foo().bar

Tests/SwiftBasicFormatTest/BasicFormatTests.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,4 +504,11 @@ final class BasicFormatTest: XCTestCase {
504504
)
505505
}
506506
}
507+
508+
func testRightAnglePeriodNotFormatted() {
509+
assertFormatted(
510+
tree: ExprSyntax("Foo<T>.bar"),
511+
expected: "Foo<T>.bar"
512+
)
513+
}
507514
}

0 commit comments

Comments
 (0)