From ef6ee160062a8d08ab2b12b788e081f518f4c7c6 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Fri, 17 Apr 2020 04:42:05 +0800 Subject: [PATCH] Fix path for proc-macro in nightly / stable build --- crates/rust-analyzer/src/cli/load_cargo.rs | 4 +--- crates/rust-analyzer/src/config.rs | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/rust-analyzer/src/cli/load_cargo.rs b/crates/rust-analyzer/src/cli/load_cargo.rs index 32a9ee339ad..018be70eeb0 100644 --- a/crates/rust-analyzer/src/cli/load_cargo.rs +++ b/crates/rust-analyzer/src/cli/load_cargo.rs @@ -73,9 +73,7 @@ pub(crate) fn load_cargo( let proc_macro_client = if !with_proc_macro { ProcMacroClient::dummy() } else { - let mut path = std::env::current_exe()?; - path.pop(); - path.push("rust-analyzer"); + let path = std::env::current_exe()?; ProcMacroClient::extern_process(&path, &["proc-macro"]).unwrap() }; let host = load(&source_roots, ws, &mut vfs, receiver, extern_dirs, &proc_macro_client); diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index 2b45f131031..3597a14e362 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -134,9 +134,7 @@ pub fn update(&mut self, value: &serde_json::Value) { match get::(value, "/procMacro/enabled") { Some(true) => { - if let Ok(mut path) = std::env::current_exe() { - path.pop(); - path.push("rust-analyzer"); + if let Ok(path) = std::env::current_exe() { self.proc_macro_srv = Some((path.to_string_lossy().to_string(), vec!["proc-macro".to_string()])); } }