mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-22 10:02:58 +00:00
Load proc-macros for rustc_private crates
This commit is contained in:
parent
ecc32c2f85
commit
c9786484c5
3 changed files with 98 additions and 22 deletions
|
@ -88,23 +88,17 @@ impl Sysroot {
|
|||
}
|
||||
|
||||
pub fn discover_with_src_override(
|
||||
dir: &AbsPath,
|
||||
current_dir: &AbsPath,
|
||||
extra_env: &FxHashMap<String, String>,
|
||||
src: AbsPathBuf,
|
||||
) -> Result<Sysroot> {
|
||||
tracing::debug!("discovering sysroot for {}", dir.display());
|
||||
let sysroot_dir = discover_sysroot_dir(dir, extra_env)?;
|
||||
tracing::debug!("discovering sysroot for {}", current_dir.display());
|
||||
let sysroot_dir = discover_sysroot_dir(current_dir, extra_env)?;
|
||||
Ok(Sysroot::load(sysroot_dir, src))
|
||||
}
|
||||
|
||||
pub fn discover_rustc(
|
||||
cargo_toml: &ManifestPath,
|
||||
extra_env: &FxHashMap<String, String>,
|
||||
) -> Option<ManifestPath> {
|
||||
tracing::debug!("discovering rustc source for {}", cargo_toml.display());
|
||||
let current_dir = cargo_toml.parent();
|
||||
let sysroot_dir = discover_sysroot_dir(current_dir, extra_env).ok()?;
|
||||
get_rustc_src(&sysroot_dir)
|
||||
pub fn discover_rustc(&self) -> Option<ManifestPath> {
|
||||
get_rustc_src(&self.root)
|
||||
}
|
||||
|
||||
pub fn with_sysroot_dir(sysroot_dir: AbsPathBuf) -> Result<Sysroot> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue