diff options
Diffstat (limited to 'crates/project_model/src/project_json.rs')
-rw-r--r-- | crates/project_model/src/project_json.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/project_model/src/project_json.rs b/crates/project_model/src/project_json.rs index a6895ecdd..aab279223 100644 --- a/crates/project_model/src/project_json.rs +++ b/crates/project_model/src/project_json.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | use std::path::PathBuf; | 3 | use std::path::PathBuf; |
4 | 4 | ||
5 | use base_db::{CrateId, CrateName, Dependency, Edition}; | 5 | use base_db::{CrateDisplayName, CrateId, CrateName, Dependency, Edition}; |
6 | use paths::{AbsPath, AbsPathBuf}; | 6 | use paths::{AbsPath, AbsPathBuf}; |
7 | use rustc_hash::FxHashMap; | 7 | use rustc_hash::FxHashMap; |
8 | use serde::{de, Deserialize}; | 8 | use serde::{de, Deserialize}; |
@@ -21,6 +21,7 @@ pub struct ProjectJson { | |||
21 | /// useful in creating the crate graph. | 21 | /// useful in creating the crate graph. |
22 | #[derive(Clone, Debug, Eq, PartialEq)] | 22 | #[derive(Clone, Debug, Eq, PartialEq)] |
23 | pub struct Crate { | 23 | pub struct Crate { |
24 | pub(crate) display_name: Option<CrateDisplayName>, | ||
24 | pub(crate) root_module: AbsPathBuf, | 25 | pub(crate) root_module: AbsPathBuf, |
25 | pub(crate) edition: Edition, | 26 | pub(crate) edition: Edition, |
26 | pub(crate) deps: Vec<Dependency>, | 27 | pub(crate) deps: Vec<Dependency>, |
@@ -68,6 +69,9 @@ impl ProjectJson { | |||
68 | }; | 69 | }; |
69 | 70 | ||
70 | Crate { | 71 | Crate { |
72 | display_name: crate_data | ||
73 | .display_name | ||
74 | .map(CrateDisplayName::from_canonical_name), | ||
71 | root_module, | 75 | root_module, |
72 | edition: crate_data.edition.into(), | 76 | edition: crate_data.edition.into(), |
73 | deps: crate_data | 77 | deps: crate_data |
@@ -114,6 +118,7 @@ pub struct ProjectJsonData { | |||
114 | 118 | ||
115 | #[derive(Deserialize)] | 119 | #[derive(Deserialize)] |
116 | struct CrateData { | 120 | struct CrateData { |
121 | display_name: Option<String>, | ||
117 | root_module: PathBuf, | 122 | root_module: PathBuf, |
118 | edition: EditionData, | 123 | edition: EditionData, |
119 | deps: Vec<DepData>, | 124 | deps: Vec<DepData>, |