Skip to content

Commit

Permalink
minor: Tweak some verbose LSP logs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
the-mikedavis committed Mar 4, 2025
1 parent 1d45378 commit ab56f9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions helix-lsp/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down
2 changes: 1 addition & 1 deletion helix-term/src/handlers/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit ab56f9e

Please sign in to comment.