@@ -700,26 +700,31 @@ export let parseCompilerLogOutput = async (
700
700
result [ file ] = [ ] ;
701
701
}
702
702
703
- let diagnostic : p . Diagnostic = {
704
- severity : parsedDiagnostic . severity ,
705
- tags : parsedDiagnostic . tag === undefined ? [ ] : [ parsedDiagnostic . tag ] ,
706
- code : parsedDiagnostic . code ,
707
- range,
708
- source : "ReScript" ,
709
- // remove start and end whitespaces/newlines
710
- message : diagnosticMessage . join ( "\n" ) . trim ( ) ,
711
- } ;
703
+ // remove start and end whitespaces/newlines
704
+ let message = diagnosticMessage . join ( "\n" ) . trim ( )
705
+
706
+ // vscode.Diagnostic throws an error if `message` is a blank string
707
+ if ( message != "" ) {
708
+ let diagnostic : p . Diagnostic = {
709
+ severity : parsedDiagnostic . severity ,
710
+ tags : parsedDiagnostic . tag === undefined ? [ ] : [ parsedDiagnostic . tag ] ,
711
+ code : parsedDiagnostic . code ,
712
+ range,
713
+ source : "ReScript" ,
714
+ message,
715
+ } ;
712
716
713
- // Check for potential code actions
714
- await codeActions . findCodeActionsInDiagnosticsMessage ( {
715
- addFoundActionsHere : foundCodeActions ,
716
- diagnostic,
717
- diagnosticMessage,
718
- file,
719
- range,
720
- } ) ;
717
+ // Check for potential code actions
718
+ await codeActions . findCodeActionsInDiagnosticsMessage ( {
719
+ addFoundActionsHere : foundCodeActions ,
720
+ diagnostic,
721
+ diagnosticMessage,
722
+ file,
723
+ range,
724
+ } ) ;
721
725
722
- result [ file ] . push ( diagnostic ) ;
726
+ result [ file ] . push ( diagnostic ) ;
727
+ }
723
728
}
724
729
725
730
return {
0 commit comments