mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Resolve core types
This adds support for completion and goto definition of types defined within the "core" crate. The core crate is added as a dependency to each crate in the project. The core crate exported it's own prelude. This caused now all crates to inherit the core crates prelude instead of the std crates. In order to avoid the problem the prelude resolution has been changed to overwrite an already resolved prelude if this was set to a crate named core - in order to pick a better prelude like std. Fixes #2199
This commit is contained in:
parent
9d786ea221
commit
799903ba16
3 changed files with 16 additions and 2 deletions
|
@ -27,6 +27,10 @@ struct SysrootCrateData {
|
|||
}
|
||||
|
||||
impl Sysroot {
|
||||
pub fn core(&self) -> Option<SysrootCrate> {
|
||||
self.by_name("core")
|
||||
}
|
||||
|
||||
pub fn std(&self) -> Option<SysrootCrate> {
|
||||
self.by_name("std")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue