aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand/src/db.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_expand/src/db.rs')
-rw-r--r--crates/ra_hir_expand/src/db.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/crates/ra_hir_expand/src/db.rs b/crates/ra_hir_expand/src/db.rs
index 32e0d5ced..f3a84cacc 100644
--- a/crates/ra_hir_expand/src/db.rs
+++ b/crates/ra_hir_expand/src/db.rs
@@ -176,10 +176,20 @@ pub(crate) fn parse_macro(
176 MacroCallId::LazyMacro(id) => { 176 MacroCallId::LazyMacro(id) => {
177 let loc: MacroCallLoc = db.lookup_intern_macro(id); 177 let loc: MacroCallLoc = db.lookup_intern_macro(id);
178 let node = loc.kind.node(db); 178 let node = loc.kind.node(db);
179
180 // collect parent information for warning log
181 let parents = std::iter::successors(loc.kind.file_id().call_node(db), |it| {
182 it.file_id.call_node(db)
183 })
184 .map(|n| format!("{:#}", n.value))
185 .collect::<Vec<_>>()
186 .join("\n");
187
179 log::warn!( 188 log::warn!(
180 "fail on macro_parse: (reason: {} macro_call: {:#})", 189 "fail on macro_parse: (reason: {} macro_call: {:#}) parents: {}",
181 err, 190 err,
182 node.value 191 node.value,
192 parents
183 ); 193 );
184 } 194 }
185 _ => { 195 _ => {