aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-04-17 10:31:57 +0100
committerGitHub <[email protected]>2020-04-17 10:31:57 +0100
commitf8016b81940f27fc4794ce75d2e7670944ef1f97 (patch)
tree81fde518c848d9b2b06da7d9ef9fe6f4fa0e0004 /crates
parent69f0cb6cd77c2dc93f2eed180a6c16fd8c3fca5a (diff)
parentef6ee160062a8d08ab2b12b788e081f518f4c7c6 (diff)
Merge #3996
3996: Fix path for proc-macro in nightly / stable release r=matklad a=edwin0cheng I messed up that I forget we use different executable names for nightly / stable release, I changed to use the current executable name instead. Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates')
-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 eb9ac32c3..762f776fe 100644
--- a/crates/rust-analyzer/src/cli/load_cargo.rs
+++ b/crates/rust-analyzer/src/cli/load_cargo.rs
@@ -75,9 +75,7 @@ pub(crate) fn load_cargo(
75 let proc_macro_client = if !with_proc_macro { 75 let proc_macro_client = if !with_proc_macro {
76 ProcMacroClient::dummy() 76 ProcMacroClient::dummy()
77 } else { 77 } else {
78 let mut path = std::env::current_exe()?; 78 let path = std::env::current_exe()?;
79 path.pop();
80 path.push("rust-analyzer");
81 ProcMacroClient::extern_process(&path, &["proc-macro"]).unwrap() 79 ProcMacroClient::extern_process(&path, &["proc-macro"]).unwrap()
82 }; 80 };
83 let host = load(&source_roots, ws, &mut vfs, receiver, extern_dirs, &proc_macro_client); 81 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 }