@@ -51,7 +51,7 @@ private async void Compile_SPScripts(bool compileAll = true)
51
51
{
52
52
// Checks if the program is compiling to avoid doing it again, and checks if the editor is from the templates window
53
53
var ee = GetCurrentEditorElement ( ) ;
54
- if ( InCompiling || ( ee != null && ee . IsTemplateEditor ) )
54
+ if ( ee == null || InCompiling || ee . IsTemplateEditor )
55
55
{
56
56
return ;
57
57
}
@@ -229,9 +229,20 @@ await this.ShowMessageAsync(Translate("SPCompNotStarted"),
229
229
230
230
switch ( process . ExitCode )
231
231
{
232
- // Successful compilation
232
+ // Successful compilation (could have warnings)
233
233
case 0 :
234
234
{
235
+ var matches = _errorFilterRegex . Matches ( sb . ToString ( ) ) ;
236
+ foreach ( Match match in matches )
237
+ {
238
+ TotalWarnings ++ ;
239
+ var item = new ErrorDataGridRow ( match ) ;
240
+ if ( ! HideWarnings )
241
+ {
242
+ ErrorResultGrid . Items . Add ( item ) ;
243
+ }
244
+ CurrentWarnings . Add ( item ) ;
245
+ }
235
246
LoggingControl . LogAction ( $ "{ fileInfo . Name } { ( TotalWarnings > 0 ? $ " ({ TotalWarnings } warnings)" : "" ) } ") ;
236
247
compiledSuccess ++ ;
237
248
break ;
@@ -244,32 +255,19 @@ await this.ShowMessageAsync(Translate("SPCompNotStarted"),
244
255
var matches = _errorFilterRegex . Matches ( sb . ToString ( ) ) ;
245
256
foreach ( Match match in matches )
246
257
{
247
- if ( match . Groups [ "Type" ] . Value . Contains ( "error" ) )
258
+ var item = new ErrorDataGridRow ( match ) ;
259
+ if ( item . IsError )
248
260
{
249
261
TotalErrors ++ ;
250
- var item = new ErrorDataGridRow
251
- {
252
- File = match . Groups [ "File" ] . Value . Trim ( ) ,
253
- Line = match . Groups [ "Line" ] . Value . Trim ( ) ,
254
- Type = match . Groups [ "Type" ] . Value . Trim ( ) ,
255
- Details = match . Groups [ "Details" ] . Value . Trim ( )
256
- } ;
257
262
if ( ! HideErrors )
258
263
{
259
264
ErrorResultGrid . Items . Add ( item ) ;
260
265
}
261
266
CurrentErrors . Add ( item ) ;
262
267
}
263
- if ( match . Groups [ "Type" ] . Value . Contains ( "warning" ) )
268
+ if ( item . IsWarning )
264
269
{
265
270
TotalWarnings ++ ;
266
- var item = new ErrorDataGridRow
267
- {
268
- File = match . Groups [ "File" ] . Value . Trim ( ) ,
269
- Line = match . Groups [ "Line" ] . Value . Trim ( ) ,
270
- Type = match . Groups [ "Type" ] . Value . Trim ( ) ,
271
- Details = match . Groups [ "Details" ] . Value . Trim ( )
272
- } ;
273
271
if ( ! HideWarnings )
274
272
{
275
273
ErrorResultGrid . Items . Add ( item ) ;
@@ -348,10 +346,11 @@ await this.ShowMessageAsync(Translate("Error"),
348
346
ProgressTask . SetProgress ( 1.0 ) ;
349
347
}
350
348
351
- if ( CompileOutputRow . Height . Value < 11.0 )
352
- {
353
- CompileOutputRow . Height = new GridLength ( 200.0 ) ;
354
- }
349
+ }
350
+
351
+ if ( CompileOutputRow . Height . Value < 11.0 )
352
+ {
353
+ CompileOutputRow . Height = new GridLength ( 200.0 ) ;
355
354
}
356
355
357
356
await ProgressTask . CloseAsync ( ) ;
0 commit comments