@@ -51,7 +51,7 @@ private async void Compile_SPScripts(bool compileAll = true)
5151 {
5252 // Checks if the program is compiling to avoid doing it again, and checks if the editor is from the templates window
5353 var ee = GetCurrentEditorElement ( ) ;
54- if ( InCompiling || ( ee != null && ee . IsTemplateEditor ) )
54+ if ( ee == null || InCompiling || ee . IsTemplateEditor )
5555 {
5656 return ;
5757 }
@@ -229,9 +229,20 @@ await this.ShowMessageAsync(Translate("SPCompNotStarted"),
229229
230230 switch ( process . ExitCode )
231231 {
232- // Successful compilation
232+ // Successful compilation (could have warnings)
233233 case 0 :
234234 {
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+ }
235246 LoggingControl . LogAction ( $ "{ fileInfo . Name } { ( TotalWarnings > 0 ? $ " ({ TotalWarnings } warnings)" : "" ) } ") ;
236247 compiledSuccess ++ ;
237248 break ;
@@ -244,32 +255,19 @@ await this.ShowMessageAsync(Translate("SPCompNotStarted"),
244255 var matches = _errorFilterRegex . Matches ( sb . ToString ( ) ) ;
245256 foreach ( Match match in matches )
246257 {
247- if ( match . Groups [ "Type" ] . Value . Contains ( "error" ) )
258+ var item = new ErrorDataGridRow ( match ) ;
259+ if ( item . IsError )
248260 {
249261 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- } ;
257262 if ( ! HideErrors )
258263 {
259264 ErrorResultGrid . Items . Add ( item ) ;
260265 }
261266 CurrentErrors . Add ( item ) ;
262267 }
263- if ( match . Groups [ "Type" ] . Value . Contains ( "warning" ) )
268+ if ( item . IsWarning )
264269 {
265270 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- } ;
273271 if ( ! HideWarnings )
274272 {
275273 ErrorResultGrid . Items . Add ( item ) ;
@@ -348,10 +346,11 @@ await this.ShowMessageAsync(Translate("Error"),
348346 ProgressTask . SetProgress ( 1.0 ) ;
349347 }
350348
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 ) ;
355354 }
356355
357356 await ProgressTask . CloseAsync ( ) ;
0 commit comments