aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/code_model.rs3
-rw-r--r--crates/ra_hir/src/semantics.rs5
-rw-r--r--crates/ra_hir/src/semantics/source_to_def.rs5
3 files changed, 5 insertions, 8 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index 0007d7fa8..5c0c6184a 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -31,7 +31,6 @@ use hir_ty::{
31 InEnvironment, Substs, TraitEnvironment, Ty, TyDefId, TypeCtor, 31 InEnvironment, Substs, TraitEnvironment, Ty, TyDefId, TypeCtor,
32}; 32};
33use ra_db::{CrateId, Edition, FileId}; 33use ra_db::{CrateId, Edition, FileId};
34use ra_prof::profile;
35use ra_syntax::{ 34use ra_syntax::{
36 ast::{self, AttrsOwner, NameOwner}, 35 ast::{self, AttrsOwner, NameOwner},
37 AstNode, 36 AstNode,
@@ -304,7 +303,7 @@ impl Module {
304 } 303 }
305 304
306 pub fn diagnostics(self, db: &dyn HirDatabase, sink: &mut DiagnosticSink) { 305 pub fn diagnostics(self, db: &dyn HirDatabase, sink: &mut DiagnosticSink) {
307 let _p = profile("Module::diagnostics"); 306 let _p = profile::span("Module::diagnostics");
308 let crate_def_map = db.crate_def_map(self.id.krate); 307 let crate_def_map = db.crate_def_map(self.id.krate);
309 crate_def_map.add_diagnostics(db.upcast(), self.id.local_id, sink); 308 crate_def_map.add_diagnostics(db.upcast(), self.id.local_id, sink);
310 for decl in self.declarations(db) { 309 for decl in self.declarations(db) {
diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs
index 36b688ccb..7e3ec6315 100644
--- a/crates/ra_hir/src/semantics.rs
+++ b/crates/ra_hir/src/semantics.rs
@@ -12,7 +12,6 @@ use hir_expand::{hygiene::Hygiene, name::AsName, ExpansionInfo};
12use hir_ty::associated_type_shorthand_candidates; 12use hir_ty::associated_type_shorthand_candidates;
13use itertools::Itertools; 13use itertools::Itertools;
14use ra_db::{FileId, FileRange}; 14use ra_db::{FileId, FileRange};
15use ra_prof::profile;
16use ra_syntax::{ 15use ra_syntax::{
17 algo::{find_node_at_offset, skip_trivia_token}, 16 algo::{find_node_at_offset, skip_trivia_token},
18 ast, AstNode, Direction, SyntaxNode, SyntaxToken, TextRange, TextSize, 17 ast, AstNode, Direction, SyntaxNode, SyntaxToken, TextRange, TextSize,
@@ -334,7 +333,7 @@ impl<'db> SemanticsImpl<'db> {
334 } 333 }
335 334
336 fn descend_into_macros(&self, token: SyntaxToken) -> SyntaxToken { 335 fn descend_into_macros(&self, token: SyntaxToken) -> SyntaxToken {
337 let _p = profile("descend_into_macros"); 336 let _p = profile::span("descend_into_macros");
338 let parent = token.parent(); 337 let parent = token.parent();
339 let parent = self.find_file(parent); 338 let parent = self.find_file(parent);
340 let sa = self.analyze2(parent.as_ref(), None); 339 let sa = self.analyze2(parent.as_ref(), None);
@@ -523,7 +522,7 @@ impl<'db> SemanticsImpl<'db> {
523 } 522 }
524 523
525 fn analyze2(&self, src: InFile<&SyntaxNode>, offset: Option<TextSize>) -> SourceAnalyzer { 524 fn analyze2(&self, src: InFile<&SyntaxNode>, offset: Option<TextSize>) -> SourceAnalyzer {
526 let _p = profile("Semantics::analyze2"); 525 let _p = profile::span("Semantics::analyze2");
527 526
528 let container = match self.with_ctx(|ctx| ctx.find_container(src)) { 527 let container = match self.with_ctx(|ctx| ctx.find_container(src)) {
529 Some(it) => it, 528 Some(it) => it,
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};
11use hir_expand::{name::AsName, AstId, MacroDefKind}; 11use hir_expand::{name::AsName, AstId, MacroDefKind};
12use ra_db::FileId; 12use ra_db::FileId;
13use ra_prof::profile;
14use ra_syntax::{ 13use 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
30impl SourceToDefCtx<'_, '_> { 29impl 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())