Skip to content

Commit 4c46b31

Browse files
authored
Merge pull request #333 from kimdv/kimdv/add-spacing-for-spaved-operator
Add leading and trailing spacing for `SpacedBinaryOperator`
2 parents 3a97187 + cf79572 commit 4c46b31

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Sources/SwiftSyntaxBuilder/gyb_generated/Tokens.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,8 @@ public extension ExpressibleAsTokenSyntax where Self == TokenSyntax {
674674

675675
static func `spacedBinaryOperator`(_ text: String) -> TokenSyntax {
676676
SyntaxFactory.makeSpacedBinaryOperator(text)
677+
.withLeadingTrivia(.spaces(1))
678+
.withTrailingTrivia(.spaces(1))
677679
}
678680

679681
static func `postfixOperator`(_ text: String) -> TokenSyntax {

Tests/SwiftSyntaxBuilderTest/FunctionTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ final class FunctionTests: XCTestCase {
5959
if n<=1{
6060
return n
6161
}
62-
return fibonacci(n-1)+fibonacci(n-2)
62+
return fibonacci(n-1) + fibonacci(n-2)
6363
}
6464
""")
6565
}

0 commit comments

Comments
 (0)