aboutsummaryrefslogtreecommitdiff
path: root/helix-lsp/src/client.rs
diff options
context:
space:
mode:
authorMichael Davis2023-02-16 01:16:25 +0000
committerGitHub2023-02-16 01:16:25 +0000
commit0f64f31d8b89c24910208bc50baa8ce03c00fbf3 (patch)
tree8cbea19d77acc3824c1dc0c1b110eec60ae82991 /helix-lsp/src/client.rs
parentd8526a752c52e73f041f76869c0e040959632927 (diff)
LSP: Add request ID to request timeout message (#6010)
This improves error logging for requests - without the ID it's hard to know which request is the one that timed out.
Diffstat (limited to 'helix-lsp/src/client.rs')
-rw-r--r--helix-lsp/src/client.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs
index 46772dd2..3f88b352 100644
--- a/helix-lsp/src/client.rs
+++ b/helix-lsp/src/client.rs
@@ -201,7 +201,7 @@ impl Client {
let request = jsonrpc::MethodCall {
jsonrpc: Some(jsonrpc::Version::V2),
- id,
+ id: id.clone(),
method: R::METHOD.to_string(),
params: Self::value_into_params(params),
};
@@ -218,7 +218,7 @@ impl Client {
// TODO: delay other calls until initialize success
timeout(Duration::from_secs(timeout_secs), rx.recv())
.await
- .map_err(|_| Error::Timeout)? // return Timeout
+ .map_err(|_| Error::Timeout(id))? // return Timeout
.ok_or(Error::StreamClosed)?
}
}