diff options
Diffstat (limited to 'crates/ra_project_model/src')
-rw-r--r-- | crates/ra_project_model/src/cargo_workspace.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/ra_project_model/src/cargo_workspace.rs b/crates/ra_project_model/src/cargo_workspace.rs index c1b6e1ddc..b50cda06f 100644 --- a/crates/ra_project_model/src/cargo_workspace.rs +++ b/crates/ra_project_model/src/cargo_workspace.rs | |||
@@ -75,7 +75,7 @@ pub type Target = Idx<TargetData>; | |||
75 | 75 | ||
76 | #[derive(Debug, Clone)] | 76 | #[derive(Debug, Clone)] |
77 | pub struct PackageData { | 77 | pub struct PackageData { |
78 | pub id: String, | 78 | pub version: String, |
79 | pub name: String, | 79 | pub name: String, |
80 | pub manifest: PathBuf, | 80 | pub manifest: PathBuf, |
81 | pub targets: Vec<Target>, | 81 | pub targets: Vec<Target>, |
@@ -174,14 +174,15 @@ impl CargoWorkspace { | |||
174 | let ws_members = &meta.workspace_members; | 174 | let ws_members = &meta.workspace_members; |
175 | 175 | ||
176 | for meta_pkg in meta.packages { | 176 | for meta_pkg in meta.packages { |
177 | let cargo_metadata::Package { id, edition, name, manifest_path, .. } = meta_pkg; | 177 | let cargo_metadata::Package { id, edition, name, manifest_path, version, .. } = |
178 | meta_pkg; | ||
178 | let is_member = ws_members.contains(&id); | 179 | let is_member = ws_members.contains(&id); |
179 | let edition = edition | 180 | let edition = edition |
180 | .parse::<Edition>() | 181 | .parse::<Edition>() |
181 | .with_context(|| format!("Failed to parse edition {}", edition))?; | 182 | .with_context(|| format!("Failed to parse edition {}", edition))?; |
182 | let pkg = packages.alloc(PackageData { | 183 | let pkg = packages.alloc(PackageData { |
183 | name, | 184 | name, |
184 | id: id.to_string(), | 185 | version: version.to_string(), |
185 | manifest: manifest_path, | 186 | manifest: manifest_path, |
186 | targets: Vec::new(), | 187 | targets: Vec::new(), |
187 | is_member, | 188 | is_member, |
@@ -256,7 +257,7 @@ impl CargoWorkspace { | |||
256 | if self.is_unique(&*package.name) { | 257 | if self.is_unique(&*package.name) { |
257 | package.name.clone() | 258 | package.name.clone() |
258 | } else { | 259 | } else { |
259 | package.id.clone() | 260 | format!("{}:{}", package.name, package.version) |
260 | } | 261 | } |
261 | } | 262 | } |
262 | 263 | ||