aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-12-21 08:48:52 +0000
committerAleksey Kladov <[email protected]>2018-12-21 08:49:18 +0000
commit164d53b22f345e50c67781af545310d2193e8a5c (patch)
tree3b9a2c722e9604e65b9b9ee2ef98d7cb5c855f45 /crates/ra_analysis/src
parentaa628f474947c46871e1ec82f87be5fc99974b36 (diff)
better debug impls
Diffstat (limited to 'crates/ra_analysis/src')
-rw-r--r--crates/ra_analysis/src/db.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/crates/ra_analysis/src/db.rs b/crates/ra_analysis/src/db.rs
index 3d0f13f34..94729d296 100644
--- a/crates/ra_analysis/src/db.rs
+++ b/crates/ra_analysis/src/db.rs
@@ -1,4 +1,4 @@
1use std::sync::Arc; 1use std::{fmt, sync::Arc};
2use salsa::{self, Database}; 2use salsa::{self, Database};
3use ra_db::{LocationIntener, BaseDatabase}; 3use ra_db::{LocationIntener, BaseDatabase};
4use hir::{self, DefId, DefLoc}; 4use hir::{self, DefId, DefLoc};
@@ -13,11 +13,19 @@ pub(crate) struct RootDatabase {
13 id_maps: Arc<IdMaps>, 13 id_maps: Arc<IdMaps>,
14} 14}
15 15
16#[derive(Debug, Default)] 16#[derive(Default)]
17struct IdMaps { 17struct IdMaps {
18 defs: LocationIntener<DefLoc, DefId>, 18 defs: LocationIntener<DefLoc, DefId>,
19} 19}
20 20
21impl fmt::Debug for IdMaps {
22 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
23 f.debug_struct("IdMaps")
24 .field("n_defs", &self.defs.len())
25 .finish()
26 }
27}
28
21impl salsa::Database for RootDatabase { 29impl salsa::Database for RootDatabase {
22 fn salsa_runtime(&self) -> &salsa::Runtime<RootDatabase> { 30 fn salsa_runtime(&self) -> &salsa::Runtime<RootDatabase> {
23 &self.runtime 31 &self.runtime