We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc6923f commit 1e112e6Copy full SHA for 1e112e6
Sources/SwiftFormatCore/SyntaxLintRule.swift
@@ -38,9 +38,17 @@ extension Rule {
38
on node: Syntax?,
39
actions: ((inout Diagnostic.Builder) -> Void)? = nil
40
) {
41
+ // TODO: node?.startLocation should be returning the position ignoring leading trivia. It isn't
42
+ // working properly, so we are using this workaround until it is fixed.
43
+ let loc = node.map {
44
+ SourceLocation(
45
+ file: context.fileURL.path,
46
+ position: $0.positionAfterSkippingLeadingTrivia
47
+ )
48
+ }
49
context.diagnosticEngine?.diagnose(
50
message.withRule(self),
- location: node?.startLocation(in: context.fileURL),
51
+ location: loc,
52
actions: actions
53
)
54
}
0 commit comments