From b9d947cc6f6f93e138781da8a7be123436166fd5 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 4 Dec 2020 20:26:28 +0100 Subject: Add slightly more profiling details --- crates/hir/src/code_model.rs | 4 +++- crates/ide_db/src/defs.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index 4500050f1..9a1e9ba49 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs @@ -362,7 +362,9 @@ impl Module { } pub fn diagnostics(self, db: &dyn HirDatabase, sink: &mut DiagnosticSink) { - let _p = profile::span("Module::diagnostics"); + let _p = profile::span("Module::diagnostics").detail(|| { + format!("{:?}", self.name(db).map_or("".into(), |name| name.to_string())) + }); let crate_def_map = db.crate_def_map(self.id.krate); crate_def_map.add_diagnostics(db.upcast(), self.id.local_id, sink); for decl in self.declarations(db) { diff --git a/crates/ide_db/src/defs.rs b/crates/ide_db/src/defs.rs index 201a3d6fa..5d2cd30d1 100644 --- a/crates/ide_db/src/defs.rs +++ b/crates/ide_db/src/defs.rs @@ -258,7 +258,7 @@ impl NameRefClass { sema: &Semantics, name_ref: &ast::NameRef, ) -> Option { - let _p = profile::span("classify_name_ref"); + let _p = profile::span("classify_name_ref").detail(|| name_ref.to_string()); let parent = name_ref.syntax().parent()?; -- cgit v1.2.3