File tree Expand file tree Collapse file tree 2 files changed +1
-11
lines changed Expand file tree Collapse file tree 2 files changed +1
-11
lines changed Original file line number Diff line number Diff line change @@ -28,12 +28,9 @@ extension Rule {
28
28
on node: Syntax ? ,
29
29
actions: ( ( inout Diagnostic . Builder ) -> Void ) ? = nil
30
30
) {
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) }
34
31
context. diagnosticEngine? . diagnose (
35
32
message. withRule ( self ) ,
36
- location: loc ,
33
+ location: node ? . startLocation ( converter : context . sourceLocationConverter ) ,
37
34
actions: actions
38
35
)
39
36
}
Original file line number Diff line number Diff line change @@ -83,13 +83,6 @@ func formatMain(
83
83
stderrStream. flush ( )
84
84
return 1
85
85
} 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
- }
93
86
stderrStream. write ( " Unable to format \( path) : \( error) \n " )
94
87
stderrStream. flush ( )
95
88
exit ( 1 )
You can’t perform that action at this time.
0 commit comments