mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Document rust-project.json
This commit is contained in:
parent
2e7d12d2f3
commit
fa019c8f56
5 changed files with 118 additions and 20 deletions
|
@ -32,6 +32,12 @@ pub enum ProjectWorkspace {
|
|||
Json { project: JsonProject },
|
||||
}
|
||||
|
||||
impl From<JsonProject> for ProjectWorkspace {
|
||||
fn from(project: JsonProject) -> ProjectWorkspace {
|
||||
ProjectWorkspace::Json { project }
|
||||
}
|
||||
}
|
||||
|
||||
/// `PackageRoot` describes a package root folder.
|
||||
/// Which may be an external dependency, or a member of
|
||||
/// the current workspace.
|
||||
|
@ -144,11 +150,11 @@ impl ProjectManifest {
|
|||
|
||||
impl ProjectWorkspace {
|
||||
pub fn load(
|
||||
root: ProjectManifest,
|
||||
manifest: ProjectManifest,
|
||||
cargo_features: &CargoConfig,
|
||||
with_sysroot: bool,
|
||||
) -> Result<ProjectWorkspace> {
|
||||
let res = match root {
|
||||
let res = match manifest {
|
||||
ProjectManifest::ProjectJson(project_json) => {
|
||||
let file = File::open(&project_json).with_context(|| {
|
||||
format!("Failed to open json file {}", project_json.display())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue