@@ -67,15 +67,15 @@ public class ParseDiagnosticsGenerator: SyntaxAnyVisitor {
67
67
// MARK: - Private helper functions
68
68
69
69
/// Produce a diagnostic.
70
- private func addDiagnostic< T: SyntaxProtocol > ( _ node: T , _ message: DiagnosticMessage , highlights: [ Syntax ] = [ ] , fixIts: [ FixIt ] = [ ] , handledNodes: [ SyntaxIdentifier ] = [ ] ) {
70
+ private func addDiagnostic< T: SyntaxProtocol > ( _ node: T , position : AbsolutePosition ? = nil , _ message: DiagnosticMessage , highlights: [ Syntax ] = [ ] , fixIts: [ FixIt ] = [ ] , handledNodes: [ SyntaxIdentifier ] = [ ] ) {
71
71
diagnostics. removeAll ( where: { handledNodes. contains ( $0. node. id) } )
72
- diagnostics. append ( Diagnostic ( node: Syntax ( node) , message: message, highlights: highlights, fixIts: fixIts) )
72
+ diagnostics. append ( Diagnostic ( node: Syntax ( node) , position : position , message: message, highlights: highlights, fixIts: fixIts) )
73
73
self . handledNodes. append ( contentsOf: handledNodes)
74
74
}
75
75
76
76
/// Produce a diagnostic.
77
- private func addDiagnostic< T: SyntaxProtocol > ( _ node: T , _ message: StaticParserError , highlights: [ Syntax ] = [ ] , fixIts: [ FixIt ] = [ ] , handledNodes: [ SyntaxIdentifier ] = [ ] ) {
78
- addDiagnostic ( node, message as DiagnosticMessage , highlights: highlights, fixIts: fixIts, handledNodes: handledNodes)
77
+ private func addDiagnostic< T: SyntaxProtocol > ( _ node: T , position : AbsolutePosition ? = nil , _ message: StaticParserError , highlights: [ Syntax ] = [ ] , fixIts: [ FixIt ] = [ ] , handledNodes: [ SyntaxIdentifier ] = [ ] ) {
78
+ addDiagnostic ( node, position : position , message as DiagnosticMessage , highlights: highlights, fixIts: fixIts, handledNodes: handledNodes)
79
79
}
80
80
81
81
/// Whether the node should be skipped for diagnostic emission.
0 commit comments