Skip to content

Commit 9ad80ef

Browse files
committed
Update to reflect changes on swift-syntax/main
1 parent 90bd987 commit 9ad80ef

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

Package.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ let package = Package(
4848
.product(name: "SwiftSyntax", package: "swift-syntax"),
4949
.product(name: "SwiftOperators", package: "swift-syntax"),
5050
.product(name: "SwiftParser", package: "swift-syntax"),
51+
.product(name: "SwiftParserDiagnostics", package: "swift-syntax"),
5152
]
5253
),
5354
.target(

Sources/SwiftFormat/Parsing.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import SwiftDiagnostics
1515
import SwiftFormatCore
1616
import SwiftOperators
1717
import SwiftParser
18+
import SwiftParserDiagnostics
1819
import SwiftSyntax
1920

2021
/// Parses the given source code and returns a valid `SourceFileSyntax` node.

Sources/SwiftFormatCore/LegacyTriviaBehavior.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import SwiftSyntax
66
/// Eventually we should get rid of this and update the core formatting code to adjust to the new
77
/// behavior, but this workaround lets us keep the current implementation without larger changes.
88
public func restoringLegacyTriviaBehavior(_ sourceFile: SourceFileSyntax) -> SourceFileSyntax {
9-
return LegacyTriviaBehaviorRewriter().visit(sourceFile).as(SourceFileSyntax.self)!
9+
return LegacyTriviaBehaviorRewriter().visit(sourceFile)
1010
}
1111

1212
private final class LegacyTriviaBehaviorRewriter: SyntaxRewriter {

0 commit comments

Comments
 (0)