@@ -48,6 +48,9 @@ pub(crate) enum BuildDataProgress {
48
48
End ( ( Arc < Vec < ProjectWorkspace > > , Vec < anyhow:: Result < WorkspaceBuildScripts > > ) ) ,
49
49
}
50
50
51
+ const STANDALONE_PROC_MACRO_SERVER_NAME : & str =
52
+ concat ! ( "rust-analyzer-proc-macro-srv" , std:: env:: consts:: EXE_SUFFIX ) ;
53
+
51
54
impl GlobalState {
52
55
pub ( crate ) fn is_quiescent ( & self ) -> bool {
53
56
!( self . fetch_workspaces_queue . op_in_progress ( )
@@ -303,12 +306,6 @@ impl GlobalState {
303
306
let files_config = self . config . files ( ) ;
304
307
let project_folders = ProjectFolders :: new ( & self . workspaces , & files_config. exclude ) ;
305
308
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
-
312
309
if self . proc_macro_clients . is_empty ( ) {
313
310
if let Some ( ( path, args) ) = self . config . proc_macro_srv ( ) {
314
311
self . proc_macro_clients = self
@@ -322,8 +319,10 @@ impl GlobalState {
322
319
tracing:: info!( "Found a cargo workspace..." ) ;
323
320
if let Some ( sysroot) = sysroot. as_ref ( ) {
324
321
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 ) ;
327
326
if std:: fs:: metadata ( & server_path) . is_ok ( ) {
328
327
tracing:: info!(
329
328
"And the server exists at {}" ,
0 commit comments