Skip to content

Commit e3dca51

Browse files
Use standalone-proc-macro-server-name
1 parent 2925b45 commit e3dca51

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

crates/rust-analyzer/src/reload.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ pub(crate) enum BuildDataProgress {
4848
End((Arc<Vec<ProjectWorkspace>>, Vec<anyhow::Result<WorkspaceBuildScripts>>)),
4949
}
5050

51+
const STANDALONE_PROC_MACRO_SERVER_NAME: &str =
52+
concat!("rust-analyzer-proc-macro-srv", std::env::consts::EXE_SUFFIX);
53+
5154
impl GlobalState {
5255
pub(crate) fn is_quiescent(&self) -> bool {
5356
!(self.fetch_workspaces_queue.op_in_progress()
@@ -303,12 +306,6 @@ impl GlobalState {
303306
let files_config = self.config.files();
304307
let project_folders = ProjectFolders::new(&self.workspaces, &files_config.exclude);
305308

306-
#[cfg(not(windows))]
307-
let standalone_server_name = "rust-analyzer-proc-macro-srv";
308-
309-
#[cfg(windows)]
310-
let standalone_server_name = "rust-analyzer-proc-macro-srv.exe";
311-
312309
if self.proc_macro_clients.is_empty() {
313310
if let Some((path, args)) = self.config.proc_macro_srv() {
314311
self.proc_macro_clients = self
@@ -322,8 +319,10 @@ impl GlobalState {
322319
tracing::info!("Found a cargo workspace...");
323320
if let Some(sysroot) = sysroot.as_ref() {
324321
tracing::info!("Found a cargo workspace with a sysroot...");
325-
let server_path =
326-
sysroot.root().join("libexec").join(standalone_server_name);
322+
let server_path = sysroot
323+
.root()
324+
.join("libexec")
325+
.join(STANDALONE_PROC_MACRO_SERVER_NAME);
327326
if std::fs::metadata(&server_path).is_ok() {
328327
tracing::info!(
329328
"And the server exists at {}",

0 commit comments

Comments
 (0)