mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
add proc-macro crate type handling
This commit is contained in:
parent
ea3124c12a
commit
6a8b4f873a
3 changed files with 30 additions and 1 deletions
|
@ -35,6 +35,10 @@ impl Sysroot {
|
|||
self.by_name("std")
|
||||
}
|
||||
|
||||
pub fn proc_macro(&self) -> Option<SysrootCrate> {
|
||||
self.by_name("proc_macro")
|
||||
}
|
||||
|
||||
pub fn crates<'a>(&'a self) -> impl Iterator<Item = SysrootCrate> + ExactSizeIterator + 'a {
|
||||
self.crates.iter().map(|(id, _data)| id)
|
||||
}
|
||||
|
@ -70,7 +74,7 @@ impl Sysroot {
|
|||
}
|
||||
}
|
||||
if let Some(alloc) = sysroot.by_name("alloc") {
|
||||
if let Some(core) = sysroot.by_name("core") {
|
||||
if let Some(core) = sysroot.core() {
|
||||
sysroot.crates[alloc].deps.push(core);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue