From ab56f9e26b5ea5a6ab355d67410d8f5515666f58 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 4 Mar 2025 11:25:09 -0500 Subject: [PATCH] minor: Tweak some verbose LSP logs The info log within `process_request_response` duplicated the body of the JSON message printed earlier by the transport which was confusing. The error log in the completion handler was easy to hit during normal use and is not actually an error - dropping is the graceful way to handle changes occurring while completion requests are in flight. --- helix-lsp/src/transport.rs | 5 +---- helix-term/src/handlers/completion.rs | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/helix-lsp/src/transport.rs b/helix-lsp/src/transport.rs index 1bded598dbda..a7399955c5f2 100644 --- a/helix-lsp/src/transport.rs +++ b/helix-lsp/src/transport.rs @@ -223,10 +223,7 @@ impl Transport { language_server_name: &str, ) -> Result<()> { let (id, result) = match output { - jsonrpc::Output::Success(jsonrpc::Success { id, result, .. }) => { - info!("{language_server_name} <- {}", result); - (id, Ok(result)) - } + jsonrpc::Output::Success(jsonrpc::Success { id, result, .. }) => (id, Ok(result)), jsonrpc::Output::Failure(jsonrpc::Failure { id, error, .. }) => { error!("{language_server_name} <- {error}"); (id, Err(error.into())) diff --git a/helix-term/src/handlers/completion.rs b/helix-term/src/handlers/completion.rs index 046cfab79a11..20fac514e170 100644 --- a/helix-term/src/handlers/completion.rs +++ b/helix-term/src/handlers/completion.rs @@ -57,7 +57,7 @@ async fn replace_completions( return; }; if handle.is_canceled() { - log::error!("dropping outdated completion response"); + log::info!("dropping outdated completion response"); return; }