aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/item_tree
diff options
context:
space:
mode:
authorcynecx <[email protected]>2021-04-14 01:36:05 +0100
committercynecx <[email protected]>2021-04-17 15:24:56 +0100
commit14918a3870d568778473f0a5697a547b85acf20a (patch)
tree0d8811909d721ddecc3277893b8df874ead68ddd /crates/hir_def/src/item_tree
parent28ef7c20d79803403be58eeffa18ab1fb21e261c (diff)
hir_def: ignore ast::Type in file_item_tree query
Diffstat (limited to 'crates/hir_def/src/item_tree')
-rw-r--r--crates/hir_def/src/item_tree/lower.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/crates/hir_def/src/item_tree/lower.rs b/crates/hir_def/src/item_tree/lower.rs
index 2975786dd..45b099cf3 100644
--- a/crates/hir_def/src/item_tree/lower.rs
+++ b/crates/hir_def/src/item_tree/lower.rs
@@ -189,16 +189,12 @@ impl Ctx {
189 block_stack.push(self.source_ast_id_map.ast_id(&block)); 189 block_stack.push(self.source_ast_id_map.ast_id(&block));
190 }, 190 },
191 ast::Item(item) => { 191 ast::Item(item) => {
192 // FIXME: This triggers for macro calls in expression/pattern 192 // FIXME: This triggers for macro calls in expression/pattern/type position
193 if let Some(SyntaxKind::MACRO_TYPE) = node.parent().map(|p| p.kind()) { 193 let mod_items = self.lower_mod_item(&item, true);
194 // Ignore macros at type position 194 let current_block = block_stack.last();
195 } else { 195 if let (Some(mod_items), Some(block)) = (mod_items, current_block) {
196 let mod_items = self.lower_mod_item(&item, true); 196 if !mod_items.0.is_empty() {
197 let current_block = block_stack.last(); 197 self.data().inner_items.entry(*block).or_default().extend(mod_items.0.iter().copied());
198 if let (Some(mod_items), Some(block)) = (mod_items, current_block) {
199 if !mod_items.0.is_empty() {
200 self.data().inner_items.entry(*block).or_default().extend(mod_items.0.iter().copied());
201 }
202 } 198 }
203 } 199 }
204 }, 200 },