fix: error responses in tests

This commit is contained in:
Wojciech Nawrocki 2020-12-30 17:56:53 -05:00 committed by Sebastian Ullrich
parent bdd0eae625
commit 2333a3fbab

View file

@ -56,10 +56,12 @@ partial def collectDiagnostics (waitForDiagnosticsId : RequestID := 0) (target :
let rec loop : IpcM (List (Notification PublishDiagnosticsParams)) := do
match ←readMessage with
| Message.response id _ =>
if id == waitForDiagnosticsId then []
else loop
| Message.responseError id code msg _ =>
if id == waitForDiagnosticsId then
[]
else
loop
throw $ userError s!"Waiting for diagnostics failed: {msg}"
else loop
| Message.notification "textDocument/publishDiagnostics" (some param) =>
match fromJson? (toJson param) with
| some diagnosticParam => ⟨"textDocument/publishDiagnostics", diagnosticParam⟩ :: (←loop)