aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2020-04-16 21:42:05 +0100
committerEdwin Cheng <[email protected]>2020-04-16 21:45:03 +0100
commitef6ee160062a8d08ab2b12b788e081f518f4c7c6 (patch)
tree9955bf90827bcb6e61ceb81937e181f93a5b59e7
parent10d8cb913cb8247ae64b954cf07460f1b6d96ef7 (diff)
Fix path for proc-macro in nightly / stable build
-rw-r--r--crates/rust-analyzer/src/cli/load_cargo.rs4
-rw-r--r--crates/rust-analyzer/src/config.rs4
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 32a9ee339..018be70ee 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(
73 let proc_macro_client = if !with_proc_macro { 73 let proc_macro_client = if !with_proc_macro {
74 ProcMacroClient::dummy() 74 ProcMacroClient::dummy()
75 } else { 75 } else {
76 let mut path = std::env::current_exe()?; 76 let path = std::env::current_exe()?;
77 path.pop();
78 path.push("rust-analyzer");
79 ProcMacroClient::extern_process(&path, &["proc-macro"]).unwrap() 77 ProcMacroClient::extern_process(&path, &["proc-macro"]).unwrap()
80 }; 78 };
81 let host = load(&source_roots, ws, &mut vfs, receiver, extern_dirs, &proc_macro_client); 79 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 2b45f1310..3597a14e3 100644
--- a/crates/rust-analyzer/src/config.rs
+++ b/crates/rust-analyzer/src/config.rs
@@ -134,9 +134,7 @@ impl Config {
134 134
135 match get::<bool>(value, "/procMacro/enabled") { 135 match get::<bool>(value, "/procMacro/enabled") {
136 Some(true) => { 136 Some(true) => {
137 if let Ok(mut path) = std::env::current_exe() { 137 if let Ok(path) = std::env::current_exe() {
138 path.pop();
139 path.push("rust-analyzer");
140 self.proc_macro_srv = Some((path.to_string_lossy().to_string(), vec!["proc-macro".to_string()])); 138 self.proc_macro_srv = Some((path.to_string_lossy().to_string(), vec!["proc-macro".to_string()]));
141 } 139 }
142 } 140 }