Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ let basicFormatFile = SourceFileSyntax(leadingTrivia: generateCopyrightHeader(fo
indentationLevel += 1
}
if let parent = node.parent, childrenSeparatedByNewline(parent) {
putNextTokenOnNewLine = true
putNextTokenOnNewLine = true && node.previousToken != nil
}
}
"""
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftBasicFormat/generated/BasicFormat.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ open class BasicFormat: SyntaxRewriter {
indentationLevel += 1
}
if let parent = node.parent, childrenSeparatedByNewline(parent) {
putNextTokenOnNewLine = true
putNextTokenOnNewLine = true && node.previousToken != nil
}
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/SwiftSyntaxBuilderTest/SourceFileTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ final class SourceFileTests: XCTestCase {
AssertBuildResult(
source,
"""

import Foundation
import UIKit
class SomeViewController {
let tableView: UITableView
}
"""
""",
trimTrailingWhitespace: false
)
}
}
2 changes: 0 additions & 2 deletions Tests/SwiftSyntaxBuilderTest/StringInterpolationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ final class StringInterpolationTests: XCTestCase {
"""
func plusOne(base: Int) -> Int {
switch base {

case 0:
return 1
case 1:
Expand Down Expand Up @@ -323,7 +322,6 @@ final class StringInterpolationTests: XCTestCase {
"""
func plusOne(base: Int) -> Int {
switch base {

case 0:
return 1
case 1:
Expand Down