From 2c7d2631faaa6348b046ca384dc92ea31ae3e458 Mon Sep 17 00:00:00 2001 From: Maxime Mangel Date: Sat, 16 Dec 2023 15:39:04 +0100 Subject: [PATCH] Reset diagnostics if no errors (#631) * Reset diagnostics if no errors * Update src/client/fsharp/FantomasOnline/State.fs --------- Co-authored-by: Florian Verdonck --- src/client/fsharp/FantomasOnline/State.fs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/fsharp/FantomasOnline/State.fs b/src/client/fsharp/FantomasOnline/State.fs index 406be8fa..cc41d1b1 100644 --- a/src/client/fsharp/FantomasOnline/State.fs +++ b/src/client/fsharp/FantomasOnline/State.fs @@ -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