From f4cfeb2a2ba47e7eac760a0187af6b4996f8ef6a Mon Sep 17 00:00:00 2001 From: a-kenji Date: Mon, 5 Aug 2024 15:15:41 +0200 Subject: [PATCH] follows: properly log removing follow nodes --- src/walk.rs | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/walk.rs b/src/walk.rs index a8a32d5..9502289 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -765,26 +765,31 @@ impl<'a> Walker { if let Some(change) = self.walk_input(&attr, &Some(context), change) { - println!("Adjust !!! {}", child.index()); - println!("Nested change: {change}"); - println!( - "Child Node: {}", + tracing::debug!("Adjusted change: {change}"); + tracing::debug!( + "Adjusted change is_empty: {}", + change.to_string().is_empty() + ); + tracing::debug!( + "Child index: {}", + child.index() + ); + tracing::debug!( + "Child node: {}", child.as_node().unwrap() ); - println!("Nested Attr : {}", nested_attr); - println!("Attr : {}", attr); - println!("Node : {}", node); - // panic!("Matched nested"); - // TODO: adjust whitespace - // return changed node - // return Some(change); + tracing::debug!("Nested Attr: {}", nested_attr); + tracing::debug!("Node: {}", node); + tracing::debug!("Attr: {}", attr); + // TODO: adjust node correctly if the change is + // not empty let replacement = Self::remove_child_with_whitespace( &nested_attr, &attr, attr.index(), ); - println!("Replacement: {}", replacement); + tracing::debug!("Replacement: {}", replacement); return Some(replacement); } }