From 48336ee84d862d33ccb62dad703a443b32a82f16 Mon Sep 17 00:00:00 2001 From: Keith Simmons Date: Sun, 8 Aug 2021 15:35:07 -0700 Subject: [PATCH] working swap to upstream nvim-rs --- Cargo.lock | 233 +++++++++++++------------------------------ Cargo.toml | 5 +- src/bridge/create.rs | 6 +- 3 files changed, 77 insertions(+), 167 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 71b8b23..61471f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,7 +63,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -85,7 +85,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -165,9 +165,9 @@ dependencies = [ [[package]] name = "bytes" -version = "0.5.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" +checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" [[package]] name = "calloop" @@ -225,7 +225,7 @@ dependencies = [ "num-integer", "num-traits", "time", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -668,7 +668,7 @@ checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" dependencies = [ "libc", "redox_users", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -744,7 +744,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall 0.2.8", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -817,22 +817,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69a039c3498dc930fe810151a34ba0c1c70b02b8625035592e74432f678591f2" -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "futures" version = "0.1.31" @@ -927,7 +911,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.6", + "pin-project-lite", "pin-utils", "proc-macro-hack", "proc-macro-nested", @@ -1015,7 +999,7 @@ dependencies = [ "parking_lot 0.11.1", "wayland-client", "wayland-egl", - "winapi 0.3.9", + "winapi", "winit", ] @@ -1025,7 +1009,7 @@ version = "0.1.5" source = "git+https://github.com/Kethku/glutin?branch=new-keyboard-all#72e148c299afe3570ab1990c553b03b4d7fdadf2" dependencies = [ "gl_generator", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1184,16 +1168,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "khronos_api" version = "3.1.0" @@ -1225,7 +1199,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" dependencies = [ "cfg-if 1.0.0", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1235,7 +1209,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" dependencies = [ "cfg-if 1.0.0", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1353,25 +1327,6 @@ dependencies = [ "autocfg 1.0.1", ] -[[package]] -name = "mio" -version = "0.6.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" -dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow 0.2.2", - "net2", - "slab", - "winapi 0.2.8", -] - [[package]] name = "mio" version = "0.7.11" @@ -1380,9 +1335,9 @@ checksum = "cf80d3e903b34e0bd7282b218398aec54e082c840d9baf8339e0080a0c542956" dependencies = [ "libc", "log", - "miow 0.3.7", + "miow", "ntapi", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1394,42 +1349,7 @@ dependencies = [ "crossbeam 0.8.0", "crossbeam-queue 0.3.1", "log", - "mio 0.7.11", -] - -[[package]] -name = "mio-named-pipes" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" -dependencies = [ - "log", - "mio 0.6.23", - "miow 0.3.7", - "winapi 0.3.9", -] - -[[package]] -name = "mio-uds" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" -dependencies = [ - "iovec", - "libc", - "mio 0.6.23", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", + "mio", ] [[package]] @@ -1438,7 +1358,7 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1552,9 +1472,10 @@ dependencies = [ "skia-safe", "swash", "tokio", + "tokio-util", "unicode-segmentation", "which 4.1.0", - "winapi 0.3.9", + "winapi", "winit", "winres", ] @@ -1567,17 +1488,6 @@ dependencies = [ "syn 1.0.72", ] -[[package]] -name = "net2" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", -] - [[package]] name = "nix" version = "0.18.0" @@ -1634,7 +1544,7 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1723,16 +1633,17 @@ dependencies = [ [[package]] name = "nvim-rs" -version = "0.1.1-alpha.0" -source = "git+https://github.com/kethku/nvim-rs#109feea9e345fcbb2674384b0d6914ba4b8fc61e" +version = "0.2.1-alpha.0" +source = "git+https://github.com/KillTheMule/nvim-rs?branch=master#a121a29ffc829ab50337d66abcd2bd4d5144c270" dependencies = [ "async-trait", "futures 0.3.15", "log", - "pin-project", + "parity-tokio-ipc", "rmp", "rmpv", "tokio", + "tokio-util", ] [[package]] @@ -1768,6 +1679,20 @@ dependencies = [ "ttf-parser", ] +[[package]] +name = "parity-tokio-ipc" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9981e32fb75e004cc148f5fb70342f393830e0a4aa62e3cc93b50976218d42b6" +dependencies = [ + "futures 0.3.15", + "libc", + "log", + "rand", + "tokio", + "winapi", +] + [[package]] name = "parking_lot" version = "0.10.2" @@ -1800,7 +1725,7 @@ dependencies = [ "libc", "redox_syscall 0.1.57", "smallvec", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1814,7 +1739,7 @@ dependencies = [ "libc", "redox_syscall 0.2.8", "smallvec", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1849,12 +1774,6 @@ dependencies = [ "syn 1.0.72", ] -[[package]] -name = "pin-project-lite" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" - [[package]] name = "pin-project-lite" version = "0.2.6" @@ -2106,7 +2025,7 @@ dependencies = [ "spin", "untrusted", "web-sys", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2468,7 +2387,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2497,25 +2416,22 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "0.2.25" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" +checksum = "4b7b349f11a7047e6d1276853e612d152f5e8a352c61917887cc2169e2366b4c" dependencies = [ - "bytes 0.5.6", - "fnv", - "iovec", - "lazy_static", + "autocfg 1.0.1", + "bytes 1.0.1", "libc", "memchr", - "mio 0.6.23", - "mio-named-pipes", - "mio-uds", + "mio", "num_cpus", - "pin-project-lite 0.1.12", + "once_cell", + "parking_lot 0.11.1", + "pin-project-lite", "signal-hook-registry", - "slab", "tokio-macros", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2531,15 +2447,30 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "0.2.6" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a" +checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110" dependencies = [ "proc-macro2 1.0.26", "quote 1.0.9", "syn 1.0.72", ] +[[package]] +name = "tokio-util" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592" +dependencies = [ + "bytes 1.0.1", + "futures-core", + "futures-io", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] + [[package]] name = "toml" version = "0.5.8" @@ -2656,7 +2587,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" dependencies = [ "same-file", - "winapi 0.3.9", + "winapi", "winapi-util", ] @@ -2857,12 +2788,6 @@ dependencies = [ "libc", ] -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -2873,12 +2798,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -2891,7 +2810,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2916,7 +2835,7 @@ dependencies = [ "libc", "log", "memmap2 0.2.3", - "mio 0.7.11", + "mio", "mio-misc", "nameof", "ndk", @@ -2930,7 +2849,7 @@ dependencies = [ "smithay-client-toolkit", "unicode-segmentation", "wayland-client", - "winapi 0.3.9", + "winapi", "x11-dl", "xkbcommon-dl", ] @@ -2944,16 +2863,6 @@ dependencies = [ "toml", ] -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "x11-dl" version = "2.18.5" diff --git a/Cargo.toml b/Cargo.toml index ee5a524..0ad241c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,8 +26,9 @@ derive-new = "0.5" rmpv = "0.4.4" rust-embed = { version = "5.2.0", features = ["debug-embed"] } image = "0.22.3" -nvim-rs = { git = "https://github.com/kethku/nvim-rs", features = ["use_tokio"] } -tokio = { version = "0.2.9", features = ["blocking", "process", "time", "tcp"] } +nvim-rs = { git = "https://github.com/KillTheMule/nvim-rs", branch = "master", features = ["use_tokio"] } +tokio = { version = "1.1.1", features = ["full"] } +tokio-util = "*" async-trait = "0.1.18" crossfire = "0.1" lazy_static = "1.4.0" diff --git a/src/bridge/create.rs b/src/bridge/create.rs index ca2d2a5..d8138f5 100644 --- a/src/bridge/create.rs +++ b/src/bridge/create.rs @@ -14,8 +14,8 @@ use tokio::{ task::JoinHandle, }; -use nvim_rs::compat::tokio::TokioAsyncReadCompatExt; use nvim_rs::{error::LoopError, neovim::Neovim, Handler}; +use tokio_util::compat::TokioAsyncReadCompatExt; use crate::bridge::{TxWrapper, WrapTx}; @@ -30,7 +30,7 @@ where { let stream = TcpStream::connect(addr).await?; let (reader, writer) = split(stream); - let (neovim, io) = Neovim::::new(reader.compat_read(), writer.wrap_tx(), handler); + let (neovim, io) = Neovim::::new(reader.compat(), writer.wrap_tx(), handler); let io_handle = spawn(io); Ok((neovim, io_handle)) @@ -51,7 +51,7 @@ where .stdout .take() .ok_or_else(|| Error::new(ErrorKind::Other, "Can't open stdout"))? - .compat_read(); + .compat(); let stdin = child .stdin .take()