From 098806ce2ab78155e102067c170fec42cd552e4a Mon Sep 17 00:00:00 2001 From: Wojciech Kępka Date: Fri, 11 Jun 2021 05:42:16 +0200 Subject: lsp: Display LSP progress messages (#216) --- helix-lsp/src/client.rs | 4 ++++ helix-lsp/src/lib.rs | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'helix-lsp/src') diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs index c2ea11b8..fde9b018 100644 --- a/helix-lsp/src/client.rs +++ b/helix-lsp/src/client.rs @@ -228,6 +228,10 @@ impl Client { }), ..Default::default() }), + window: Some(lsp::WindowClientCapabilities { + work_done_progress: Some(true), + ..Default::default() + }), ..Default::default() }, trace: None, diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index 6d40cf0a..08676066 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -134,6 +134,7 @@ pub enum Notification { PublishDiagnostics(lsp::PublishDiagnosticsParams), ShowMessage(lsp::ShowMessageParams), LogMessage(lsp::LogMessageParams), + ProgressMessage(lsp::ProgressParams), } impl Notification { @@ -151,17 +152,20 @@ impl Notification { } lsp::notification::ShowMessage::METHOD => { - let params: lsp::ShowMessageParams = - params.parse().expect("Failed to parse ShowMessage params"); + let params: lsp::ShowMessageParams = params.parse().ok()?; Self::ShowMessage(params) } lsp::notification::LogMessage::METHOD => { - let params: lsp::LogMessageParams = - params.parse().expect("Failed to parse ShowMessage params"); + let params: lsp::LogMessageParams = params.parse().ok()?; Self::LogMessage(params) } + lsp::notification::Progress::METHOD => { + let params: lsp::ProgressParams = params.parse().ok()?; + + Self::ProgressMessage(params) + } _ => { log::error!("unhandled LSP notification: {}", method); return None; -- cgit v1.2.3-70-g09d2