This repository has been archived by the owner on May 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgpkg: rust-analyzer 20221114-3: Support standalone server in both l…
…ib and libexec Thanks to @heftig for the new patch and Akatsuki Rui (akiirui) for their testing. Fixes FS#76568 Upstream issue: rust-lang/rust-analyzer#13589 git-svn-id: file:///srv/repos/svn-community/svn@1348996 9fca08f4-af9d-4005-b8df-a31f2cc04f65
- Loading branch information
polyzen
committed
Nov 15, 2022
1 parent
1d4ce98
commit 426bffc
Showing
3 changed files
with
68 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
rust-analyzer/trunk/rust-analyzer-fix_unsupportedabi.patch
This file was deleted.
Oops, something went wrong.
64 changes: 64 additions & 0 deletions
64
rust-analyzer/trunk/rust-analyzer-support_standalone_server_in_lib.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
diff --git c/crates/rust-analyzer/src/cli/load_cargo.rs i/crates/rust-analyzer/src/cli/load_cargo.rs | ||
index 5dba545b8..c9faeaa6b 100644 | ||
--- c/crates/rust-analyzer/src/cli/load_cargo.rs | ||
+++ i/crates/rust-analyzer/src/cli/load_cargo.rs | ||
@@ -69,10 +69,13 @@ pub fn load_workspace( | ||
if let Some(sysroot) = sysroot.as_ref() { | ||
let standalone_server_name = | ||
format!("rust-analyzer-proc-macro-srv{}", std::env::consts::EXE_SUFFIX); | ||
- let server_path = sysroot.root().join("libexec").join(&standalone_server_name); | ||
- if std::fs::metadata(&server_path).is_ok() { | ||
- path = server_path; | ||
- args = vec![]; | ||
+ for dir in ["libexec", "lib"] { | ||
+ let server_path = sysroot.root().join(dir).join(&standalone_server_name); | ||
+ if std::fs::metadata(&server_path).is_ok() { | ||
+ path = server_path; | ||
+ args = vec![]; | ||
+ break; | ||
+ } | ||
} | ||
} | ||
} | ||
diff --git c/crates/rust-analyzer/src/reload.rs i/crates/rust-analyzer/src/reload.rs | ||
index aa0510a4e..d7cf69c3a 100644 | ||
--- c/crates/rust-analyzer/src/reload.rs | ||
+++ i/crates/rust-analyzer/src/reload.rs | ||
@@ -327,21 +327,22 @@ impl GlobalState { | ||
| ProjectWorkspace::Json { sysroot, .. } = ws | ||
{ | ||
if let Some(sysroot) = sysroot.as_ref() { | ||
- let server_path = sysroot | ||
- .root() | ||
- .join("libexec") | ||
- .join(&standalone_server_name); | ||
- if std::fs::metadata(&server_path).is_ok() { | ||
- tracing::debug!( | ||
- "Sysroot proc-macro server exists at {}", | ||
- server_path.display() | ||
- ); | ||
- sysroot_server = Some(server_path); | ||
- } else { | ||
- tracing::debug!( | ||
- "Sysroot proc-macro server does not exist at {}", | ||
- server_path.display() | ||
- ); | ||
+ for dir in ["libexec", "lib"] { | ||
+ let server_path = | ||
+ sysroot.root().join(dir).join(&standalone_server_name); | ||
+ if std::fs::metadata(&server_path).is_ok() { | ||
+ tracing::debug!( | ||
+ "Sysroot proc-macro server exists at {}", | ||
+ server_path.display() | ||
+ ); | ||
+ sysroot_server = Some(server_path); | ||
+ break; | ||
+ } else { | ||
+ tracing::debug!( | ||
+ "Sysroot proc-macro server does not exist at {}", | ||
+ server_path.display() | ||
+ ); | ||
+ } | ||
} | ||
} | ||
} |