diff options
author | Michael Davis | 2023-02-16 01:16:25 +0000 |
---|---|---|
committer | GitHub | 2023-02-16 01:16:25 +0000 |
commit | 0f64f31d8b89c24910208bc50baa8ce03c00fbf3 (patch) | |
tree | 8cbea19d77acc3824c1dc0c1b110eec60ae82991 /helix-lsp/src/jsonrpc.rs | |
parent | d8526a752c52e73f041f76869c0e040959632927 (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/jsonrpc.rs')
-rw-r--r-- | helix-lsp/src/jsonrpc.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/helix-lsp/src/jsonrpc.rs b/helix-lsp/src/jsonrpc.rs index 69d02707..f415dde0 100644 --- a/helix-lsp/src/jsonrpc.rs +++ b/helix-lsp/src/jsonrpc.rs @@ -108,6 +108,16 @@ pub enum Id { Str(String), } +impl std::fmt::Display for Id { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Id::Null => f.write_str("null"), + Id::Num(num) => write!(f, "{}", num), + Id::Str(string) => f.write_str(string), + } + } +} + /// Protocol Version #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)] pub enum Version { |