diff options
Diffstat (limited to 'crates/ra_hir/src/semantics')
-rw-r--r-- | crates/ra_hir/src/semantics/source_to_def.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/ra_hir/src/semantics/source_to_def.rs b/crates/ra_hir/src/semantics/source_to_def.rs index 863e8e5ff..a6ff8b0bf 100644 --- a/crates/ra_hir/src/semantics/source_to_def.rs +++ b/crates/ra_hir/src/semantics/source_to_def.rs | |||
@@ -10,7 +10,6 @@ use hir_def::{ | |||
10 | }; | 10 | }; |
11 | use hir_expand::{name::AsName, AstId, MacroDefKind}; | 11 | use hir_expand::{name::AsName, AstId, MacroDefKind}; |
12 | use ra_db::FileId; | 12 | use ra_db::FileId; |
13 | use ra_prof::profile; | ||
14 | use ra_syntax::{ | 13 | use ra_syntax::{ |
15 | ast::{self, NameOwner}, | 14 | ast::{self, NameOwner}, |
16 | match_ast, AstNode, SyntaxNode, | 15 | match_ast, AstNode, SyntaxNode, |
@@ -29,7 +28,7 @@ pub(super) struct SourceToDefCtx<'a, 'b> { | |||
29 | 28 | ||
30 | impl SourceToDefCtx<'_, '_> { | 29 | impl SourceToDefCtx<'_, '_> { |
31 | pub(super) fn file_to_def(&mut self, file: FileId) -> Option<ModuleId> { | 30 | pub(super) fn file_to_def(&mut self, file: FileId) -> Option<ModuleId> { |
32 | let _p = profile("SourceBinder::to_module_def"); | 31 | let _p = profile::span("SourceBinder::to_module_def"); |
33 | let (krate, local_id) = self.db.relevant_crates(file).iter().find_map(|&crate_id| { | 32 | let (krate, local_id) = self.db.relevant_crates(file).iter().find_map(|&crate_id| { |
34 | let crate_def_map = self.db.crate_def_map(crate_id); | 33 | let crate_def_map = self.db.crate_def_map(crate_id); |
35 | let local_id = crate_def_map.modules_for_file(file).next()?; | 34 | let local_id = crate_def_map.modules_for_file(file).next()?; |
@@ -39,7 +38,7 @@ impl SourceToDefCtx<'_, '_> { | |||
39 | } | 38 | } |
40 | 39 | ||
41 | pub(super) fn module_to_def(&mut self, src: InFile<ast::Module>) -> Option<ModuleId> { | 40 | pub(super) fn module_to_def(&mut self, src: InFile<ast::Module>) -> Option<ModuleId> { |
42 | let _p = profile("module_to_def"); | 41 | let _p = profile::span("module_to_def"); |
43 | let parent_declaration = src | 42 | let parent_declaration = src |
44 | .as_ref() | 43 | .as_ref() |
45 | .map(|it| it.syntax()) | 44 | .map(|it| it.syntax()) |