| 1 |
Description: avoid not-in-Debian crate sonic-rs |
| 2 |
This essentially reverts upstream git commit e4c5388 |
| 3 |
Author: Jonas Smedegaard <[email protected]> |
| 4 |
Forwarded: not-needed |
| 5 |
Last-Update: 2025-12-08 |
| 6 |
--- |
| 7 |
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ |
| 8 |
--- a/Cargo.toml |
| 9 |
+++ b/Cargo.toml |
| 10 |
@@ -53,7 +53,6 @@ |
| 11 |
tokio-stream = "0.1.18" |
| 12 |
toml = "1.1" |
| 13 |
termina = "0.3" |
| 14 |
|
| 15 |
globset = "0.4" |
| 16 |
etcetera = ">= 0.10.0, <= 0.11" |
| 17 |
arc-swap = "1.9" |
| 18 |
--- a/helix-dap/Cargo.toml |
| 19 |
+++ b/helix-dap/Cargo.toml |
| 20 |
@@ -28,4 +28,3 @@ |
| 21 |
futures-executor.workspace = true |
| 22 |
futures-util.workspace = true |
| 23 |
tokio-stream.workspace = true |
| 24 |
|
| 25 |
--- a/helix-dap/src/lib.rs |
| 26 |
+++ b/helix-dap/src/lib.rs |
| 27 |
@@ -13,7 +13,7 @@ |
| 28 |
#[derive(Error, Debug)] |
| 29 |
pub enum Error { |
| 30 |
#[error("failed to parse: {0}")] |
| 31 |
|
| 32 |
+ Parse(#[from] serde_json::Error), |
| 33 |
#[error("IO Error: {0}")] |
| 34 |
IO(#[from] std::io::Error), |
| 35 |
#[error("request {0} timed out")] |
| 36 |
@@ -29,18 +29,6 @@ |
| 37 |
} |
| 38 |
pub type Result<T> = core::result::Result<T, Error>; |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
#[derive(Debug)] |
| 53 |
pub enum Request { |
| 54 |
RunInTerminal(<requests::RunInTerminal as helix_dap_types::Request>::Arguments), |
| 55 |
--- a/helix-dap/src/transport.rs |
| 56 |
+++ b/helix-dap/src/transport.rs |
| 57 |
@@ -125,14 +125,12 @@ |
| 58 |
|
| 59 |
info!("[{}] <- DAP {}", id, msg); |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
+ // try parsing as output (server response) or call (server request) |
| 66 |
+ let output: serde_json::Result<Payload> = serde_json::from_str(msg); |
| 67 |
|
| 68 |
content.clear(); |
| 69 |
|
| 70 |
|
| 71 |
+ Ok(output?) |
| 72 |
} |
| 73 |
|
| 74 |
async fn recv_server_error( |
| 75 |
--- a/helix-lsp/Cargo.toml |
| 76 |
+++ b/helix-lsp/Cargo.toml |
| 77 |
@@ -32,4 +32,3 @@ |
| 78 |
arc-swap = "1" |
| 79 |
slotmap.workspace = true |
| 80 |
thiserror.workspace = true |
| 81 |
|
| 82 |
--- a/helix-lsp/src/lib.rs |
| 83 |
+++ b/helix-lsp/src/lib.rs |
| 84 |
@@ -39,7 +39,7 @@ |
| 85 |
#[error("protocol error: {0}")] |
| 86 |
Rpc(#[from] jsonrpc::Error), |
| 87 |
#[error("failed to parse: {0}")] |
| 88 |
|
| 89 |
+ Parse(#[from] serde_json::Error), |
| 90 |
#[error("IO Error: {0}")] |
| 91 |
IO(#[from] std::io::Error), |
| 92 |
#[error("request {0} timed out")] |
| 93 |
@@ -54,18 +54,6 @@ |
| 94 |
Other(#[from] anyhow::Error), |
| 95 |
} |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] |
| 110 |
pub enum OffsetEncoding { |
| 111 |
/// UTF-8 code units aka bytes |
| 112 |
--- a/helix-lsp/src/transport.rs |
| 113 |
+++ b/helix-lsp/src/transport.rs |
| 114 |
@@ -111,7 +111,7 @@ |
| 115 |
buffer.clear(); |
| 116 |
if reader.read_line(buffer).await? == 0 { |
| 117 |
return Err(Error::StreamClosed); |
| 118 |
|
| 119 |
+ }; |
| 120 |
|
| 121 |
// debug!("<- header {:?}", buffer); |
| 122 |
|
| 123 |
@@ -146,14 +146,12 @@ |
| 124 |
|
| 125 |
info!("{language_server_name} <- {msg}"); |
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
+ // try parsing as output (server response) or call (server request) |
| 132 |
+ let output: serde_json::Result<ServerMessage> = serde_json::from_str(msg); |
| 133 |
|
| 134 |
content.clear(); |
| 135 |
|
| 136 |
|
| 137 |
+ Ok(output?) |
| 138 |
} |
| 139 |
|
| 140 |
async fn recv_server_error( |