mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-27 18:26:19 +00:00
fix: Do not warn about proc-macro srv when sysroot is missing
This commit is contained in:
parent
a3dc41bf97
commit
d1149cba49
5 changed files with 56 additions and 41 deletions
|
|
@ -163,18 +163,18 @@ impl Sysroot {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn discover_proc_macro_srv(&self) -> anyhow::Result<AbsPathBuf> {
|
||||
let Some(root) = self.root() else {
|
||||
return Err(anyhow::format_err!("no sysroot",));
|
||||
};
|
||||
["libexec", "lib"]
|
||||
.into_iter()
|
||||
.map(|segment| root.join(segment).join("rust-analyzer-proc-macro-srv"))
|
||||
.find_map(|server_path| probe_for_binary(server_path.into()))
|
||||
.map(AbsPathBuf::assert)
|
||||
.ok_or_else(|| {
|
||||
anyhow::format_err!("cannot find proc-macro server in sysroot `{}`", root)
|
||||
})
|
||||
pub fn discover_proc_macro_srv(&self) -> Option<anyhow::Result<AbsPathBuf>> {
|
||||
let root = self.root()?;
|
||||
Some(
|
||||
["libexec", "lib"]
|
||||
.into_iter()
|
||||
.map(|segment| root.join(segment).join("rust-analyzer-proc-macro-srv"))
|
||||
.find_map(|server_path| probe_for_binary(server_path.into()))
|
||||
.map(AbsPathBuf::assert)
|
||||
.ok_or_else(|| {
|
||||
anyhow::format_err!("cannot find proc-macro server in sysroot `{}`", root)
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
fn assemble(
|
||||
|
|
|
|||
|
|
@ -744,7 +744,7 @@ impl ProjectWorkspace {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn find_sysroot_proc_macro_srv(&self) -> anyhow::Result<AbsPathBuf> {
|
||||
pub fn find_sysroot_proc_macro_srv(&self) -> Option<anyhow::Result<AbsPathBuf>> {
|
||||
self.sysroot.discover_proc_macro_srv()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue