Skip to content

Commit

Permalink
Reset diagnostics if no errors (#631)
Browse files Browse the repository at this point in the history
* Reset diagnostics if no errors

* Update src/client/fsharp/FantomasOnline/State.fs

---------

Co-authored-by: Florian Verdonck <[email protected]>
  • Loading branch information
MangelMaxime and nojaf authored Dec 16, 2023
1 parent 6c7baa0 commit 2c7d263
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client/fsharp/FantomasOnline/State.fs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ let update isActiveTab (bubble: BubbleModel) msg model =
| FormattedReceived result ->
let cmd =
if Array.isEmpty result.FirstValidation && Array.isEmpty result.SecondValidation then
Cmd.none
// Make sure to reset the diagnostics if there are no errors
Array.empty |> BubbleMessage.SetDiagnostics |> Msg.Bubble |> Cmd.ofMsg
elif Array.isEmpty result.SecondValidation then
result.FirstValidation
|> BubbleMessage.SetDiagnostics
Expand Down

0 comments on commit 2c7d263

Please sign in to comment.