@@ -12,6 +12,8 @@ public static class ProcessorDiagnosticExtensions
1212{
1313 public static void EmitError ( this InlineProcessor processor , int line , int column , int length , string message )
1414 {
15+ var context = processor . GetContext ( ) ;
16+ if ( context . SkipValidation ) return ;
1517 var d = new Diagnostic
1618 {
1719 Severity = Severity . Error ,
@@ -21,6 +23,53 @@ public static void EmitError(this InlineProcessor processor, int line, int colum
2123 Message = message ,
2224 Length = length
2325 } ;
24- processor . GetBuildContext ( ) . Collector . Channel . Write ( d ) ;
26+ context . Build . Collector . Channel . Write ( d ) ;
27+ }
28+
29+
30+ public static void EmitWarning ( this BlockProcessor processor , int line , int column , int length , string message )
31+ {
32+ var context = processor . GetContext ( ) ;
33+ if ( context . SkipValidation ) return ;
34+ var d = new Diagnostic
35+ {
36+ Severity = Severity . Warning ,
37+ File = processor . GetContext ( ) . Path . FullName ,
38+ Column = column ,
39+ Line = line ,
40+ Message = message ,
41+ Length = length
42+ } ;
43+ context . Build . Collector . Channel . Write ( d ) ;
44+ }
45+
46+ public static void EmitError ( this ParserContext context , int line , int column , int length , string message )
47+ {
48+ if ( context . SkipValidation ) return ;
49+ var d = new Diagnostic
50+ {
51+ Severity = Severity . Error ,
52+ File = context . Path . FullName ,
53+ Column = column ,
54+ Line = line ,
55+ Message = message ,
56+ Length = length
57+ } ;
58+ context . Build . Collector . Channel . Write ( d ) ;
59+ }
60+
61+ public static void EmitWarning ( this ParserContext context , int line , int column , int length , string message )
62+ {
63+ if ( context . SkipValidation ) return ;
64+ var d = new Diagnostic
65+ {
66+ Severity = Severity . Warning ,
67+ File = context . Path . FullName ,
68+ Column = column ,
69+ Line = line ,
70+ Message = message ,
71+ Length = length
72+ } ;
73+ context . Build . Collector . Channel . Write ( d ) ;
2574 }
2675}
0 commit comments