Unnamed repository; edit this file 'description' to name the repository.
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.
Michael Davis 12 months ago
parent 1d45378 · commit ab56f9e
-rw-r--r--helix-lsp/src/transport.rs5
-rw-r--r--helix-term/src/handlers/completion.rs2
2 files changed, 2 insertions, 5 deletions
diff --git a/helix-lsp/src/transport.rs b/helix-lsp/src/transport.rs
index 1bded598..a7399955 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 046cfab7..20fac514 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;
}