File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -176,16 +176,21 @@ pub(crate) fn parse_macro(
176176 MacroCallId :: LazyMacro ( id) => {
177177 let loc: MacroCallLoc = db. lookup_intern_macro ( id) ;
178178 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+
179188 log:: warn!(
180- "fail on macro_parse: (reason: {} macro_call: {:#})" ,
189+ "fail on macro_parse: (reason: {} macro_call: {:#}) parents: {} " ,
181190 err,
182- node. value
191+ node. value,
192+ parents
183193 ) ;
184- let mut parent = loc. kind . file_id ( ) . call_node ( db) ;
185- while let Some ( node) = parent. clone ( ) {
186- log:: warn!( "parent: macro_call: {:#})" , node. value) ;
187- parent = node. file_id . call_node ( db) ;
188- }
189194 }
190195 _ => {
191196 log:: warn!( "fail on macro_parse: (reason: {})" , err) ;
You can’t perform that action at this time.
0 commit comments