From 4d5e80c6c86aa6bfee50e9f8b80b365c3120ed80 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Wed, 4 Mar 2020 01:24:33 +0800 Subject: [PATCH] Fix for rebasing --- crates/ra_hir_expand/src/db.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) 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()?;