diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index 13ac32ff91cf..47a376bb85af 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -276,7 +276,13 @@ impl Notification { lsp::notification::PublishDiagnostics::METHOD => { let params: lsp::PublishDiagnosticsParams = params .parse() - .expect("Failed to parse PublishDiagnostics params"); + .map_err(|err| { + log::error!( + "received malformed PublishDiagnostic from Language Server: {}", + err + ) + }) + .ok()?; // TODO: need to loop over diagnostics and distinguish them by URI Self::PublishDiagnostics(params)