Show dbg remove assist on empty contents
@@ -94,9 +94,6 @@ fn get_valid_macrocall_contents(
let mut contents_between_brackets = children_with_tokens.collect::<Vec<_>>();
let last_child = contents_between_brackets.pop()?;
- if contents_between_brackets.is_empty() {
- None
- } else {
match (first_child.kind(), last_child.kind()) {
(T!['('], T![')']) | (T!['['], T![']']) | (T!['{'], T!['}']) => {
Some(contents_between_brackets)
@@ -104,7 +101,6 @@ fn get_valid_macrocall_contents(
_ => None,
}
}
-}
fn needs_parentheses_around_macro_contents(macro_contents: Vec<SyntaxElement>) -> bool {
if macro_contents.len() < 2 {
@@ -418,4 +414,9 @@ fn main() {
}"#,
);
}
+
+ #[test]
+ fn test_remove_empty_dbg() {
+ check_assist(remove_dbg, r#"$0dbg!()"#, r#""#);
+ }
}
