diff options
-rw-r--r-- | crates/ra_hir/src/from_source.rs | 11 | ||||
-rw-r--r-- | crates/ra_hir_def/src/nameres/collector.rs | 3 | ||||
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting.rs | 3 |
3 files changed, 7 insertions, 10 deletions
diff --git a/crates/ra_hir/src/from_source.rs b/crates/ra_hir/src/from_source.rs index 7756ca80e..9f7c22b21 100644 --- a/crates/ra_hir/src/from_source.rs +++ b/crates/ra_hir/src/from_source.rs | |||
@@ -262,12 +262,11 @@ impl Module { | |||
262 | 262 | ||
263 | let original_file = src.file_id.original_file(db); | 263 | let original_file = src.file_id.original_file(db); |
264 | 264 | ||
265 | let (krate, local_id) = | 265 | let (krate, local_id) = db.relevant_crates(original_file).iter().find_map(|&crate_id| { |
266 | db.relevant_crates(original_file).iter().find_map(|&crate_id| { | 266 | let crate_def_map = db.crate_def_map(crate_id); |
267 | let crate_def_map = db.crate_def_map(crate_id); | 267 | let local_id = crate_def_map.modules_for_file(original_file).next()?; |
268 | let local_id = crate_def_map.modules_for_file(original_file).next()?; | 268 | Some((crate_id, local_id)) |
269 | Some((crate_id, local_id)) | 269 | })?; |
270 | })?; | ||
271 | Some(Module { id: ModuleId { krate, local_id } }) | 270 | Some(Module { id: ModuleId { krate, local_id } }) |
272 | } | 271 | } |
273 | } | 272 | } |
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index 6cd14026b..603b49738 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs | |||
@@ -682,8 +682,7 @@ where | |||
682 | } | 682 | } |
683 | 683 | ||
684 | fn define_def(&mut self, def: &raw::DefData) { | 684 | fn define_def(&mut self, def: &raw::DefData) { |
685 | let module = | 685 | let module = ModuleId { krate: self.def_collector.def_map.krate, local_id: self.module_id }; |
686 | ModuleId { krate: self.def_collector.def_map.krate, local_id: self.module_id }; | ||
687 | let ctx = LocationCtx::new(self.def_collector.db, module, self.file_id); | 686 | let ctx = LocationCtx::new(self.def_collector.db, module, self.file_id); |
688 | 687 | ||
689 | let name = def.name.clone(); | 688 | let name = def.name.clone(); |
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index 2c568a747..9a3e4c82f 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs | |||
@@ -332,8 +332,7 @@ fn bar() { | |||
332 | "# | 332 | "# |
333 | .trim(), | 333 | .trim(), |
334 | ); | 334 | ); |
335 | let dst_file = | 335 | let dst_file = project_dir().join("crates/ra_ide/src/snapshots/rainbow_highlighting.html"); |
336 | project_dir().join("crates/ra_ide/src/snapshots/rainbow_highlighting.html"); | ||
337 | let actual_html = &analysis.highlight_as_html(file_id, true).unwrap(); | 336 | let actual_html = &analysis.highlight_as_html(file_id, true).unwrap(); |
338 | let expected_html = &read_text(&dst_file); | 337 | let expected_html = &read_text(&dst_file); |
339 | std::fs::write(dst_file, &actual_html).unwrap(); | 338 | std::fs::write(dst_file, &actual_html).unwrap(); |