Fix path for proc-macro in nightly / stable build

This commit is contained in:
Edwin Cheng 2020-04-17 04:42:05 +08:00
parent 10d8cb913c
commit ef6ee16006
2 changed files with 2 additions and 6 deletions

View File

@ -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);

View File

@ -134,9 +134,7 @@ pub fn update(&mut self, value: &serde_json::Value) {
match get::<bool>(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()]));
}
}