aboutsummaryrefslogtreecommitdiff
path: root/crates/base_db/src
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2020-10-02 19:16:22 +0100
committerKirill Bulatov <[email protected]>2020-10-02 19:16:22 +0100
commit99952f3be254394a5c70ce8fb8436d76c779ed71 (patch)
tree1dd257a6e3813ff901a9ec70969640d58e90aee6 /crates/base_db/src
parentcae2e859ffbf2b435c8675838e450b66d4c6153e (diff)
Fix the hover dash issues
Diffstat (limited to 'crates/base_db/src')
-rw-r--r--crates/base_db/src/fixture.rs6
-rw-r--r--crates/base_db/src/input.rs4
2 files changed, 5 insertions, 5 deletions
diff --git a/crates/base_db/src/fixture.rs b/crates/base_db/src/fixture.rs
index 31560bc09..72f1fd667 100644
--- a/crates/base_db/src/fixture.rs
+++ b/crates/base_db/src/fixture.rs
@@ -154,15 +154,15 @@ impl ChangeFixture {
154 assert!(meta.path.starts_with(&source_root_prefix)); 154 assert!(meta.path.starts_with(&source_root_prefix));
155 155
156 if let Some(krate) = meta.krate { 156 if let Some(krate) = meta.krate {
157 let crate_name = CrateName::normalize_dashes(&krate);
157 let crate_id = crate_graph.add_crate_root( 158 let crate_id = crate_graph.add_crate_root(
158 file_id, 159 file_id,
159 meta.edition, 160 meta.edition,
160 Some(krate.clone()), 161 Some(crate_name.clone()),
161 meta.cfg, 162 meta.cfg,
162 meta.env, 163 meta.env,
163 Default::default(), 164 Default::default(),
164 ); 165 );
165 let crate_name = CrateName::normalize_dashes(&krate);
166 let prev = crates.insert(crate_name.clone(), crate_id); 166 let prev = crates.insert(crate_name.clone(), crate_id);
167 assert!(prev.is_none()); 167 assert!(prev.is_none());
168 for dep in meta.deps { 168 for dep in meta.deps {
@@ -187,7 +187,7 @@ impl ChangeFixture {
187 crate_graph.add_crate_root( 187 crate_graph.add_crate_root(
188 crate_root, 188 crate_root,
189 Edition::Edition2018, 189 Edition::Edition2018,
190 Some("test".to_string()), 190 Some(CrateName::new("test").unwrap()),
191 default_cfg, 191 default_cfg,
192 Env::default(), 192 Env::default(),
193 Default::default(), 193 Default::default(),
diff --git a/crates/base_db/src/input.rs b/crates/base_db/src/input.rs
index 9a61f1d56..251a7b245 100644
--- a/crates/base_db/src/input.rs
+++ b/crates/base_db/src/input.rs
@@ -130,7 +130,7 @@ pub struct CrateData {
130 /// The name to display to the end user. 130 /// The name to display to the end user.
131 /// This actual crate name can be different in a particular dependent crate 131 /// This actual crate name can be different in a particular dependent crate
132 /// or may even be missing for some cases, such as a dummy crate for the code snippet. 132 /// or may even be missing for some cases, such as a dummy crate for the code snippet.
133 pub display_name: Option<String>, 133 pub display_name: Option<CrateName>,
134 pub cfg_options: CfgOptions, 134 pub cfg_options: CfgOptions,
135 pub env: Env, 135 pub env: Env,
136 pub dependencies: Vec<Dependency>, 136 pub dependencies: Vec<Dependency>,
@@ -159,7 +159,7 @@ impl CrateGraph {
159 &mut self, 159 &mut self,
160 file_id: FileId, 160 file_id: FileId,
161 edition: Edition, 161 edition: Edition,
162 display_name: Option<String>, 162 display_name: Option<CrateName>,
163 cfg_options: CfgOptions, 163 cfg_options: CfgOptions,
164 env: Env, 164 env: Env,
165 proc_macro: Vec<(SmolStr, Arc<dyn tt::TokenExpander>)>, 165 proc_macro: Vec<(SmolStr, Arc<dyn tt::TokenExpander>)>,