chore: update major dependencies and fix API breakages

This commit is contained in:
Riz Ashraf committed 2026-09-22 05:08:42 +01:00
1 parent 05672cc884
commit c8f8ff8997
7 files changed
+518 -387

No files matched your search

Generated
+492 -365
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -9,11 +9,11 @@ serde_json = "1.0"
rmp-serde = "1.1"
rmpv = "1.0"
tokio = { version = "1.37", features = ["full"] }
schemars = "0.8"
schemars = "1.2.2"
tracing-appender = "0.2.5"
tracing = "0.1.44"
tracing-subscriber = "0.3.23"
dirs = "7.0.0"
rustls = "0.22.4"
rustls = "0.23.45"
rustls-pki-types = "1"
nvim-core = { path = "../nvim-core" }
+15 -11
View File
@@ -111,7 +111,7 @@ use std::sync::LazyLock;
use tokio::sync::{mpsc, oneshot};
pub struct NvimRequest {
pub msgid_str: String,
pub msgid: u64,
pub req: rmpv::Value,
pub reply: oneshot::Sender<Result<rmpv::Value, String>>,
}
@@ -153,7 +153,7 @@ async fn get_nvim_connection() -> Result<mpsc::Sender<NvimRequest>, String> {
let (mut read_half, mut write_half) = tokio::io::split(stream);
let (tx, mut rx) = mpsc::channel::<NvimRequest>(32);
type PendingRequestsMap =
Arc<std::sync::Mutex<HashMap<String, oneshot::Sender<Result<rmpv::Value, String>>>>>;
Arc<std::sync::Mutex<HashMap<u64, oneshot::Sender<Result<rmpv::Value, String>>>>>;
let pending_requests: PendingRequestsMap = Arc::new(std::sync::Mutex::new(HashMap::new()));
// Write task
@@ -169,7 +169,7 @@ async fn get_nvim_connection() -> Result<mpsc::Sender<NvimRequest>, String> {
pending_clone
.lock()
.unwrap()
.insert(req.msgid_str.clone(), req.reply);
.insert(req.msgid, req.reply);
if write_half.write_all(&buf).await.is_err() {
tracing::error!("Failed to write to Neovim socket");
@@ -193,13 +193,15 @@ async fn get_nvim_connection() -> Result<mpsc::Sender<NvimRequest>, String> {
if let rmpv::Value::Array(ref arr) = val {
if arr.len() >= 4 && arr[0] == rmpv::Value::Integer(1.into()) {
let msgid = &arr[1];
let msgid_str = format!("{msgid:?}");
let msgid = match &arr[1] {
rmpv::Value::Integer(i) => i.as_u64().unwrap_or(0),
_ => 0,
};
if let Some(reply_sender) = pending_clone2
.lock()
.unwrap_or_else(|e| e.into_inner())
.remove(&msgid_str)
.remove(&msgid)
{
let _ = reply_sender.send(Ok(val));
}
@@ -279,20 +281,22 @@ async fn get_nvim_connection() -> Result<mpsc::Sender<NvimRequest>, String> {
async fn call_nvim(req: rmpv::Value) -> Result<rmpv::Value, String> {
let msgid = if let rmpv::Value::Array(ref arr) = req {
if arr.len() > 1 {
arr[1].clone()
match &arr[1] {
rmpv::Value::Integer(i) => i.as_u64().unwrap_or(0),
_ => 0,
}
} else {
rmpv::Value::Nil
0
}
} else {
rmpv::Value::Nil
0
};
let msgid_str = format!("{msgid:?}");
let tx = get_nvim_connection().await?;
let (reply_tx, reply_rx) = oneshot::channel();
tx.send(NvimRequest {
msgid_str,
msgid,
req,
reply: reply_tx,
})
+4 -4
View File
@@ -9,13 +9,13 @@ axum = { version = "0.8", features = ["ws"] }
bincode = "1.3.3"
clap = { version = "4.6.6", features = ["derive"] }
dashmap = "6.2.1"
dirs = "6.0.0"
dirs = "7.0.0"
futures-util = "0.3.34"
glob = "0.3.4"
git2 = { version = "0.19.0", default-features = false }
notify = "6.1.1"
git2 = { version = "0.21.0", default-features = false }
notify = "8.2.0"
redb = "4.2.0"
reqwest = { version = "0.12", default-features = false, features = ["stream", "rustls-tls", "json"] }
reqwest = { version = "0.13", default-features = false, features = ["stream", "rustls", "json"] }
schemars = "1.2.2"
serde = { version = "1.0.229", features = ["derive"] }
serde_json = "1.0.151"
+2 -2
View File
@@ -6,11 +6,11 @@ edition = "2024"
[dependencies]
#rustls-tls = "0.2"
clap = { version = "4.6.6", features = ["derive"] }
reqwest = { version = "0.12", default-features = false, features = ["stream", "rustls-tls"] }
reqwest = { version = "0.13", default-features = false, features = ["stream", "rustls"] }
tokio = { version = "1.53.1", features = ["full"] }
tokio-util = { version = "0.7.19", features = ["io"] }
futures-util = "0.3.34"
tokio-tungstenite = { version = "0.21.0" }
tokio-tungstenite = { version = "0.30.0" }
tracing-appender = "0.2.5"
tracing = "0.1.44"
tracing-subscriber = "0.3.23"
+1 -1
View File
@@ -102,7 +102,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
if msg.len() > 1000 { "..." } else { "" }
);
if write
.send(tokio_tungstenite::tungstenite::Message::Text(msg))
.send(tokio_tungstenite::tungstenite::Message::Text(msg.into()))
.await
.is_err()
{
+2 -2
View File
@@ -9,13 +9,13 @@ serde_json = "1.0"
rmp-serde = "1.1"
rmpv = "1.0"
tokio = { version = "1.37", features = ["full"] }
schemars = "0.8"
schemars = "1.2.2"
tracing-appender = "0.2.5"
tracing = "0.1.44"
tracing-subscriber = "0.3.23"
dirs = "7.0.0"
rustls = "0.22.4"
rustls = "0.23.45"
rustls-pki-types = "1"
nvim-core = { path = "../nvim-core" }