In rust-analyzer, we maintain a strict separation between pure abstract semantic project model and a concrete model of a particular build system.
Pure model is represented by the
base_db::CrateGraph from another crate.
In this crate, we are conserned with “real world” project models.
Roughly, the things we do here are:
- Project discovery (where’s the relevant Cargo.toml for the current dir).
- Custom build steps (
build.rscode generation and compilation of procedural macros).
- Lowering of concrete model to a
CargoWorkspace represents the logical structure of, well, a Cargo
workspace. It pretty closely mirrors
cargo metadata output.
Information associated with a cargo crate
PackageRoot describes a package root folder.
Which may be an external dependency, or a member of
the current workspace.
Roots and crates that compose this Rust project.
Information associated with a package’s target
A set of cfg-overrides per crate.
Describes how to set the rustc source directory.
Crates to disable