Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Bump async-lsp to v0.0.5 #2186

Merged
merged 4 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,3 @@ url = "2.2.0"
wasm-bindgen = { version = "=0.2.86", features = ["serde-serialize"] }
wasm-bindgen-test = "0.3.33"
base64 = "0.21.2"

[patch.crates-io]
async-lsp = { git = "https://github.com/oxalica/async-lsp", rev = "09dbcc11046f7a188a80137f8d36484d86c78c78" }
2 changes: 1 addition & 1 deletion crates/lsp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ noirc_frontend.workspace = true
serde_json.workspace = true
toml.workspace = true
tower.workspace = true
async-lsp = { version = "0.0.4", default-features = false, features = ["omni-trait"] }
async-lsp = { version = "0.0.5", default-features = false, features = ["omni-trait"] }

[dev-dependencies]
tokio = { version = "1.0", features = ["macros"] }
4 changes: 3 additions & 1 deletion crates/nargo_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,18 @@ serde.workspace = true
serde_json.workspace = true
thiserror.workspace = true
tower.workspace = true
async-lsp = { version = "0.0.4", default-features = false, features = [
async-lsp = { version = "0.0.5", default-features = false, features = [
"client-monitor",
"stdio",
"tracing",
"tokio"
] }
const_format = "0.2.30"
hex = "0.4.2"
termcolor = "1.1.2"
color-eyre = "0.6.2"
tokio = { version = "1.0", features = ["io-std"] }
tokio-util = { version = "0.7.8", features = ["compat"] }

# Backends
acvm-backend-barretenberg = { version = "0.10.0", default-features = false }
Expand Down
14 changes: 7 additions & 7 deletions crates/nargo_cli/src/cli/lsp_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use async_lsp::{
};
use clap::Args;
use noir_lsp::NargoLspService;
use tokio::io::BufReader;
use tower::ServiceBuilder;

use super::NargoConfig;
Expand All @@ -30,7 +29,7 @@ pub(crate) fn run<B: Backend>(
let runtime = Builder::new_current_thread().enable_all().build().unwrap();

runtime.block_on(async {
let (server, _) = async_lsp::Frontend::new_server(|client| {
let (server, _) = async_lsp::MainLoop::new_server(|client| {
let router = NargoLspService::new(&client);

ServiceBuilder::new()
Expand All @@ -42,18 +41,19 @@ pub(crate) fn run<B: Backend>(
.service(router)
});

// Prefer truely asynchronous piped stdin/stdout without blocking tasks.
// Prefer truly asynchronous piped stdin/stdout without blocking tasks.
#[cfg(unix)]
let (stdin, stdout) = (
async_lsp::stdio::PipeStdin::lock_tokio().unwrap(),
async_lsp::stdio::PipeStdout::lock_tokio().unwrap(),
);
// Fallback to spawn blocking read/write otherwise.
#[cfg(not(unix))]
let (stdin, stdout) = (tokio::io::stdin(), tokio::io::stdout());

let stdin = BufReader::new(stdin);
let (stdin, stdout) = (
tokio_util::compat::TokioAsyncReadCompatExt::compat(tokio::io::stdin()),
tokio_util::compat::TokioAsyncWriteCompatExt::compat_write(tokio::io::stdout()),
);

server.run(stdin, stdout).await.map_err(CliError::LspError)
server.run_buffered(stdin, stdout).await.map_err(CliError::LspError)
})
}
Loading