diff options
Diffstat (limited to 'crates/hir_def/src/db.rs')
-rw-r--r-- | crates/hir_def/src/db.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/hir_def/src/db.rs b/crates/hir_def/src/db.rs index 7fe6f6346..6c01f1ed0 100644 --- a/crates/hir_def/src/db.rs +++ b/crates/hir_def/src/db.rs | |||
@@ -58,6 +58,21 @@ pub trait DefDatabase: InternDatabase + AstDatabase + Upcast<dyn AstDatabase> { | |||
58 | #[salsa::invoke(DefMap::crate_def_map_query)] | 58 | #[salsa::invoke(DefMap::crate_def_map_query)] |
59 | fn crate_def_map_query(&self, krate: CrateId) -> Arc<DefMap>; | 59 | fn crate_def_map_query(&self, krate: CrateId) -> Arc<DefMap>; |
60 | 60 | ||
61 | /// Computes the block-level `DefMap`, returning `None` when `block` doesn't contain any inner | ||
62 | /// items directly. | ||
63 | /// | ||
64 | /// For example: | ||
65 | /// | ||
66 | /// ``` | ||
67 | /// fn f() { // (0) | ||
68 | /// { // (1) | ||
69 | /// fn inner() {} | ||
70 | /// } | ||
71 | /// } | ||
72 | /// ``` | ||
73 | /// | ||
74 | /// The `block_def_map` for block 0 would return `None`, while `block_def_map` of block 1 would | ||
75 | /// return a `DefMap` containing `inner`. | ||
61 | #[salsa::invoke(DefMap::block_def_map_query)] | 76 | #[salsa::invoke(DefMap::block_def_map_query)] |
62 | fn block_def_map(&self, block: BlockId) -> Option<Arc<DefMap>>; | 77 | fn block_def_map(&self, block: BlockId) -> Option<Arc<DefMap>>; |
63 | 78 | ||