From 59f42abb419829f5bcde103d0b18616779ea05f3 Mon Sep 17 00:00:00 2001 From: zino <38125460+zino23@users.noreply.github.com> Date: Sat, 30 Nov 2024 00:37:20 +0800 Subject: [PATCH 1/4] chore: make lsp server spawning error more helpful by attachging a ctx (#29) --- src/app.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app.rs b/src/app.rs index f140898..04f81e7 100644 --- a/src/app.rs +++ b/src/app.rs @@ -100,7 +100,7 @@ pub fn run_app_forever(client_reader: impl std::io::Read + Send + 'static, client_writer: impl std::io::Write + Send + 'static, mut server_cmd: std::process::Command, options: AppOptions) -> Result { - info!("Running server {:?}", server_cmd); + info!("About to run the lsp server with command {:?}", server_cmd); if let Some(ref bytecode_options) = options.bytecode_options { info!("Will convert server json to bytecode! bytecode options: {:?}", bytecode_options); } else { @@ -111,7 +111,13 @@ pub fn run_app_forever(client_reader: impl std::io::Read + Send + 'static, .stdin(std::process::Stdio::piped()) .stdout(std::process::Stdio::piped()) .stderr(std::process::Stdio::inherit()) - .spawn()?; + .spawn() + .with_context(|| { + format!( + "Failed to run the lsp server with command: {:?}", + server_cmd + ) + })?; let (c2s_channel_pub, c2s_channel_sub) = mpsc::channel::(); let c2s_channel_counter = Arc::new(AtomicI32::new(0)); From 35241510a4342d8560cc047182526513b232e276 Mon Sep 17 00:00:00 2001 From: Yikai Zhao Date: Tue, 7 Jan 2025 23:38:43 +0800 Subject: [PATCH 2/4] Fill all required fields in Cargo.toml for publishing --- Cargo.toml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d73d3b1..131f442 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,13 @@ [package] name = "emacs-lsp-booster" -version = "0.0.0" # this package will never be published as lib, so ignore this version field +description = "Emacs LSP performance booster " +homepage = "https://github.com/blahgeek/emacs-lsp-booster" +repository = "https://github.com/blahgeek/emacs-lsp-booster" +readme = "README.md" +keywords = ["emacs", "lsp"] +categories = ["command-line-utilities", "development-tools"] +license = "MIT" +version = "0.2.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 905ffe2c0de2fbfc8f387eaafd25cf4f093a79cd Mon Sep 17 00:00:00 2001 From: Yikai Zhao Date: Tue, 7 Jan 2025 23:40:37 +0800 Subject: [PATCH 3/4] Update cargo.lock --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bea9f14..fe91f25 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -207,7 +207,7 @@ dependencies = [ [[package]] name = "emacs-lsp-booster" -version = "0.0.0" +version = "0.2.1" dependencies = [ "anyhow", "clap", From bdf4c42b0227a157cd472b06f2a72beb6808f2b8 Mon Sep 17 00:00:00 2001 From: Yikai Zhao Date: Tue, 7 Jan 2025 23:47:49 +0800 Subject: [PATCH 4/4] Update build instructions from crates.io --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b195016..cda558f 100644 --- a/README.md +++ b/README.md @@ -53,13 +53,10 @@ For Linux or Windows users, you may download the prebuilt binary from [release]( *(The macOS binary in the release page lacks proper code signing for now.)* A flake for nix users is available [here](https://github.com/slotThe/emacs-lsp-booster-flake). -Alternatively, you may build the target locally: +Alternatively, you may install it from [crates.io](https://crates.io/crates/emacs-lsp-booster): 1. Setup [Rust toolchain](https://www.rust-lang.org/tools/install) -2. Run `cargo build --release` -3. Find the built binary in `target/release/emacs-lsp-booster` - -Then, put the `emacs-lsp-booster` binary in your $PATH (e.g. `~/.local/bin`). +2. Run `cargo install emacs-lsp-booster`. Make sure to include the cargo bin folder in your $PATH. ### Configure `lsp-mode`