@@ -122,41 +122,30 @@ public static void EmitWarning(this DiagnosticsCollector collector, IFileInfo fi
122
122
collector . Channel . Write ( d ) ;
123
123
}
124
124
125
- public static void EmitError ( this IBlockExtension block , string message , Exception ? e = null )
126
- {
127
- if ( block . SkipValidation )
128
- return ;
125
+ public static void EmitError ( this IBlockExtension block , string message , Exception ? e = null ) => EmitDiagnostic ( block , Severity . Error , message , e ) ;
129
126
130
- var d = new Diagnostic
131
- {
132
- Severity = Severity . Error ,
133
- File = block . CurrentFile . FullName ,
134
- Line = block . Line + 1 ,
135
- Column = block . Column ,
136
- Length = block . OpeningLength + 5 ,
137
- Message = CreateExceptionMessage ( message , e ) ,
138
- } ;
139
- block . Build . Collector . Channel . Write ( d ) ;
140
- }
127
+ public static void EmitWarning ( this IBlockExtension block , string message ) => EmitDiagnostic ( block , Severity . Warning , message ) ;
141
128
129
+ public static void EmitHint ( this IBlockExtension block , string message ) => EmitDiagnostic ( block , Severity . Hint , message ) ;
142
130
143
- public static void EmitWarning ( this IBlockExtension block , string message )
131
+ private static void EmitDiagnostic ( IBlockExtension block , Severity severity , string message , Exception ? e = null )
144
132
{
145
133
if ( block . SkipValidation )
146
134
return ;
147
135
148
136
var d = new Diagnostic
149
137
{
150
- Severity = Severity . Warning ,
138
+ Severity = severity ,
151
139
File = block . CurrentFile . FullName ,
152
140
Line = block . Line + 1 ,
153
141
Column = block . Column ,
154
- Length = block . OpeningLength + 4 ,
155
- Message = message
142
+ Length = block . OpeningLength + 5 ,
143
+ Message = CreateExceptionMessage ( message , e ) ,
156
144
} ;
157
145
block . Build . Collector . Channel . Write ( d ) ;
158
146
}
159
147
148
+
160
149
private static void LinkDiagnostic ( InlineProcessor processor , Severity severity , Inline inline , int length , string message , Exception ? e = null )
161
150
{
162
151
var line = inline . Line + 1 ;
0 commit comments