Skip to content

Commit 2efa25d

Browse files
committed
Remove some more stale workarounds.
1 parent 3634b8b commit 2efa25d

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

Sources/SwiftFormatCore/SyntaxLintRule.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,9 @@ extension Rule {
2828
on node: Syntax?,
2929
actions: ((inout Diagnostic.Builder) -> Void)? = nil
3030
) {
31-
// TODO: node?.startLocation should be returning the position ignoring leading trivia. It isn't
32-
// working properly, so we are using this workaround until it is fixed.
33-
let loc = node.map { $0.startLocation(converter: context.sourceLocationConverter) }
3431
context.diagnosticEngine?.diagnose(
3532
message.withRule(self),
36-
location: loc,
33+
location: node?.startLocation(converter: context.sourceLocationConverter),
3734
actions: actions
3835
)
3936
}

Sources/swift-format/Run.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,6 @@ func formatMain(
8383
stderrStream.flush()
8484
return 1
8585
} catch {
86-
// Workaround: we're unable to directly catch unknownTokenKind errors due to access
87-
// restrictions. TODO: this can be removed when we update to Swift 5.0.
88-
if "\(error)" == "unknownTokenKind(\"pound_error\")" {
89-
stderrStream.write("Unable to format \(path): unknownTokenKind(\"pound_error\")\n")
90-
stderrStream.flush()
91-
return 1
92-
}
9386
stderrStream.write("Unable to format \(path): \(error)\n")
9487
stderrStream.flush()
9588
exit(1)

0 commit comments

Comments
 (0)