diff options
Diffstat (limited to 'crates/ra_project_model/src/lib.rs')
-rw-r--r-- | crates/ra_project_model/src/lib.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs index ac88532f0..7e8e00df8 100644 --- a/crates/ra_project_model/src/lib.rs +++ b/crates/ra_project_model/src/lib.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | 2 | ||
3 | mod cargo_workspace; | 3 | mod cargo_workspace; |
4 | mod json_project; | 4 | mod project_json; |
5 | mod sysroot; | 5 | mod sysroot; |
6 | 6 | ||
7 | use std::{ | 7 | use std::{ |
@@ -20,7 +20,7 @@ use serde_json::from_reader; | |||
20 | 20 | ||
21 | pub use crate::{ | 21 | pub use crate::{ |
22 | cargo_workspace::{CargoConfig, CargoWorkspace, Package, Target, TargetKind}, | 22 | cargo_workspace::{CargoConfig, CargoWorkspace, Package, Target, TargetKind}, |
23 | json_project::JsonProject, | 23 | project_json::ProjectJson, |
24 | sysroot::Sysroot, | 24 | sysroot::Sysroot, |
25 | }; | 25 | }; |
26 | pub use ra_proc_macro::ProcMacroClient; | 26 | pub use ra_proc_macro::ProcMacroClient; |
@@ -30,7 +30,7 @@ pub enum ProjectWorkspace { | |||
30 | /// Project workspace was discovered by running `cargo metadata` and `rustc --print sysroot`. | 30 | /// Project workspace was discovered by running `cargo metadata` and `rustc --print sysroot`. |
31 | Cargo { cargo: CargoWorkspace, sysroot: Sysroot }, | 31 | Cargo { cargo: CargoWorkspace, sysroot: Sysroot }, |
32 | /// Project workspace was manually specified using a `rust-project.json` file. | 32 | /// Project workspace was manually specified using a `rust-project.json` file. |
33 | Json { project: JsonProject, project_location: AbsPathBuf }, | 33 | Json { project: ProjectJson, project_location: AbsPathBuf }, |
34 | } | 34 | } |
35 | 35 | ||
36 | /// `PackageRoot` describes a package root folder. | 36 | /// `PackageRoot` describes a package root folder. |
@@ -259,8 +259,8 @@ impl ProjectWorkspace { | |||
259 | let file_path = project_location.join(&krate.root_module); | 259 | let file_path = project_location.join(&krate.root_module); |
260 | let file_id = load(&file_path)?; | 260 | let file_id = load(&file_path)?; |
261 | let edition = match krate.edition { | 261 | let edition = match krate.edition { |
262 | json_project::Edition::Edition2015 => Edition::Edition2015, | 262 | project_json::Edition::Edition2015 => Edition::Edition2015, |
263 | json_project::Edition::Edition2018 => Edition::Edition2018, | 263 | project_json::Edition::Edition2018 => Edition::Edition2018, |
264 | }; | 264 | }; |
265 | let cfg_options = { | 265 | let cfg_options = { |
266 | let mut opts = CfgOptions::default(); | 266 | let mut opts = CfgOptions::default(); |
@@ -290,7 +290,7 @@ impl ProjectWorkspace { | |||
290 | .map(|it| proc_macro_client.by_dylib_path(&it)); | 290 | .map(|it| proc_macro_client.by_dylib_path(&it)); |
291 | // FIXME: No crate name in json definition such that we cannot add OUT_DIR to env | 291 | // FIXME: No crate name in json definition such that we cannot add OUT_DIR to env |
292 | Some(( | 292 | Some(( |
293 | json_project::CrateId(seq_index), | 293 | project_json::CrateId(seq_index), |
294 | crate_graph.add_crate_root( | 294 | crate_graph.add_crate_root( |
295 | file_id, | 295 | file_id, |
296 | edition, | 296 | edition, |
@@ -306,7 +306,7 @@ impl ProjectWorkspace { | |||
306 | 306 | ||
307 | for (id, krate) in project.crates.iter().enumerate() { | 307 | for (id, krate) in project.crates.iter().enumerate() { |
308 | for dep in &krate.deps { | 308 | for dep in &krate.deps { |
309 | let from_crate_id = json_project::CrateId(id); | 309 | let from_crate_id = project_json::CrateId(id); |
310 | let to_crate_id = dep.krate; | 310 | let to_crate_id = dep.krate; |
311 | if let (Some(&from), Some(&to)) = | 311 | if let (Some(&from), Some(&to)) = |
312 | (crates.get(&from_crate_id), crates.get(&to_crate_id)) | 312 | (crates.get(&from_crate_id), crates.get(&to_crate_id)) |
@@ -528,7 +528,7 @@ impl ProjectWorkspace { | |||
528 | ProjectWorkspace::Cargo { cargo, .. } => { | 528 | ProjectWorkspace::Cargo { cargo, .. } => { |
529 | Some(cargo.workspace_root()).filter(|root| path.starts_with(root)) | 529 | Some(cargo.workspace_root()).filter(|root| path.starts_with(root)) |
530 | } | 530 | } |
531 | ProjectWorkspace::Json { project: JsonProject { roots, .. }, .. } => roots | 531 | ProjectWorkspace::Json { project: ProjectJson { roots, .. }, .. } => roots |
532 | .iter() | 532 | .iter() |
533 | .find(|root| path.starts_with(&root.path)) | 533 | .find(|root| path.starts_with(&root.path)) |
534 | .map(|root| root.path.as_ref()), | 534 | .map(|root| root.path.as_ref()), |