diff --git a/crates/ra_hir_expand/src/db.rs b/crates/ra_hir_expand/src/db.rs index ac8256a845..32e0d5ced3 100644 --- a/crates/ra_hir_expand/src/db.rs +++ b/crates/ra_hir_expand/src/db.rs @@ -172,9 +172,20 @@ pub(crate) fn parse_macro( // Note: // The final goal we would like to make all parse_macro success, // such that the following log will not call anyway. - let loc: MacroCallLoc = db.lookup_intern_macro(macro_call_id); - let node = loc.kind.node(db); - log::warn!("fail on macro_parse: (reason: {} macro_call: {:#})", err, node.value); + match macro_call_id { + MacroCallId::LazyMacro(id) => { + let loc: MacroCallLoc = db.lookup_intern_macro(id); + let node = loc.kind.node(db); + log::warn!( + "fail on macro_parse: (reason: {} macro_call: {:#})", + err, + node.value + ); + } + _ => { + log::warn!("fail on macro_parse: (reason: {})", err); + } + } }) .ok()?;