diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-10 14:35:46 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-10 14:35:46 +0100 |
commit | 9ab59e2162bf7dcb120378e0c2e9fd6dac39c107 (patch) | |
tree | 2dfd1838493bf62b3f790f3c7c5943993b15af0d /crates/ra_project_model | |
parent | 0f7770ae43dd0d97686eb85fccb38801ff30117b (diff) | |
parent | d0a8f6a3eb5094af36a72ca01b290a494dfd7b16 (diff) |
Merge #5293
5293: Automatically reload project info on Cargo.toml changes r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_project_model')
-rw-r--r-- | crates/ra_project_model/src/cargo_workspace.rs | 8 | ||||
-rw-r--r-- | crates/ra_project_model/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/ra_project_model/src/sysroot.rs | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_project_model/src/cargo_workspace.rs b/crates/ra_project_model/src/cargo_workspace.rs index 04f7eb741..6d1154056 100644 --- a/crates/ra_project_model/src/cargo_workspace.rs +++ b/crates/ra_project_model/src/cargo_workspace.rs | |||
@@ -24,7 +24,7 @@ use rustc_hash::FxHashMap; | |||
24 | /// | 24 | /// |
25 | /// We use absolute paths here, `cargo metadata` guarantees to always produce | 25 | /// We use absolute paths here, `cargo metadata` guarantees to always produce |
26 | /// abs paths. | 26 | /// abs paths. |
27 | #[derive(Debug, Clone)] | 27 | #[derive(Debug, Clone, Eq, PartialEq)] |
28 | pub struct CargoWorkspace { | 28 | pub struct CargoWorkspace { |
29 | packages: Arena<PackageData>, | 29 | packages: Arena<PackageData>, |
30 | targets: Arena<TargetData>, | 30 | targets: Arena<TargetData>, |
@@ -68,7 +68,7 @@ pub type Package = Idx<PackageData>; | |||
68 | 68 | ||
69 | pub type Target = Idx<TargetData>; | 69 | pub type Target = Idx<TargetData>; |
70 | 70 | ||
71 | #[derive(Debug, Clone)] | 71 | #[derive(Debug, Clone, Eq, PartialEq)] |
72 | pub struct PackageData { | 72 | pub struct PackageData { |
73 | pub version: String, | 73 | pub version: String, |
74 | pub name: String, | 74 | pub name: String, |
@@ -83,13 +83,13 @@ pub struct PackageData { | |||
83 | pub proc_macro_dylib_path: Option<AbsPathBuf>, | 83 | pub proc_macro_dylib_path: Option<AbsPathBuf>, |
84 | } | 84 | } |
85 | 85 | ||
86 | #[derive(Debug, Clone)] | 86 | #[derive(Debug, Clone, Eq, PartialEq)] |
87 | pub struct PackageDependency { | 87 | pub struct PackageDependency { |
88 | pub pkg: Package, | 88 | pub pkg: Package, |
89 | pub name: String, | 89 | pub name: String, |
90 | } | 90 | } |
91 | 91 | ||
92 | #[derive(Debug, Clone)] | 92 | #[derive(Debug, Clone, Eq, PartialEq)] |
93 | pub struct TargetData { | 93 | pub struct TargetData { |
94 | pub package: Package, | 94 | pub package: Package, |
95 | pub name: String, | 95 | pub name: String, |
diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs index 5d1f871c4..b9c5424bf 100644 --- a/crates/ra_project_model/src/lib.rs +++ b/crates/ra_project_model/src/lib.rs | |||
@@ -24,7 +24,7 @@ pub use crate::{ | |||
24 | }; | 24 | }; |
25 | pub use ra_proc_macro::ProcMacroClient; | 25 | pub use ra_proc_macro::ProcMacroClient; |
26 | 26 | ||
27 | #[derive(Debug, Clone)] | 27 | #[derive(Debug, Clone, Eq, PartialEq)] |
28 | pub enum ProjectWorkspace { | 28 | pub enum ProjectWorkspace { |
29 | /// Project workspace was discovered by running `cargo metadata` and `rustc --print sysroot`. | 29 | /// Project workspace was discovered by running `cargo metadata` and `rustc --print sysroot`. |
30 | Cargo { cargo: CargoWorkspace, sysroot: Sysroot }, | 30 | Cargo { cargo: CargoWorkspace, sysroot: Sysroot }, |
diff --git a/crates/ra_project_model/src/sysroot.rs b/crates/ra_project_model/src/sysroot.rs index fc1673ede..68d134da4 100644 --- a/crates/ra_project_model/src/sysroot.rs +++ b/crates/ra_project_model/src/sysroot.rs | |||
@@ -3,19 +3,19 @@ | |||
3 | use std::{convert::TryFrom, env, ops, path::Path, process::Command}; | 3 | use std::{convert::TryFrom, env, ops, path::Path, process::Command}; |
4 | 4 | ||
5 | use anyhow::{bail, format_err, Result}; | 5 | use anyhow::{bail, format_err, Result}; |
6 | use paths::{AbsPath, AbsPathBuf}; | ||
6 | use ra_arena::{Arena, Idx}; | 7 | use ra_arena::{Arena, Idx}; |
7 | 8 | ||
8 | use crate::output; | 9 | use crate::output; |
9 | use paths::{AbsPath, AbsPathBuf}; | ||
10 | 10 | ||
11 | #[derive(Default, Debug, Clone)] | 11 | #[derive(Default, Debug, Clone, Eq, PartialEq)] |
12 | pub struct Sysroot { | 12 | pub struct Sysroot { |
13 | crates: Arena<SysrootCrateData>, | 13 | crates: Arena<SysrootCrateData>, |
14 | } | 14 | } |
15 | 15 | ||
16 | pub type SysrootCrate = Idx<SysrootCrateData>; | 16 | pub type SysrootCrate = Idx<SysrootCrateData>; |
17 | 17 | ||
18 | #[derive(Debug, Clone)] | 18 | #[derive(Debug, Clone, Eq, PartialEq)] |
19 | pub struct SysrootCrateData { | 19 | pub struct SysrootCrateData { |
20 | pub name: String, | 20 | pub name: String, |
21 | pub root: AbsPathBuf, | 21 | pub root: AbsPathBuf, |