From 4adf13e2efa396bfeab553b7243b6a3bcd57db07 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Tue, 2 Feb 2021 04:55:17 +0800 Subject: Only allow one proc-macro process --- crates/rust-analyzer/src/reload.rs | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs index 031a0cef4..c4f1d098b 100644 --- a/crates/rust-analyzer/src/reload.rs +++ b/crates/rust-analyzer/src/reload.rs @@ -269,20 +269,22 @@ impl GlobalState { let project_folders = ProjectFolders::new(&workspaces, &files_config.exclude, workspace_build_data.as_ref()); - self.proc_macro_client = match self.config.proc_macro_srv() { - None => None, - Some((path, args)) => match ProcMacroClient::extern_process(path.clone(), args) { - Ok(it) => Some(it), - Err(err) => { - log::error!( - "Failed to run proc_macro_srv from path {}, error: {:?}", - path.display(), - err - ); - None - } - }, - }; + if self.proc_macro_client.is_none() { + self.proc_macro_client = match self.config.proc_macro_srv() { + None => None, + Some((path, args)) => match ProcMacroClient::extern_process(path.clone(), args) { + Ok(it) => Some(it), + Err(err) => { + log::error!( + "Failed to run proc_macro_srv from path {}, error: {:?}", + path.display(), + err + ); + None + } + }, + }; + } let watch = match files_config.watcher { FilesWatcher::Client => vec![], -- cgit v1.2.3