File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
crates/ide_assists/src/handlers Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -94,15 +94,11 @@ fn get_valid_macrocall_contents(
94
94
let mut contents_between_brackets = children_with_tokens. collect :: < Vec < _ > > ( ) ;
95
95
let last_child = contents_between_brackets. pop ( ) ?;
96
96
97
- if contents_between_brackets. is_empty ( ) {
98
- None
99
- } else {
100
- match ( first_child. kind ( ) , last_child. kind ( ) ) {
101
- ( T ! [ '(' ] , T ! [ ')' ] ) | ( T ! [ '[' ] , T ! [ ']' ] ) | ( T ! [ '{' ] , T ! [ '}' ] ) => {
102
- Some ( contents_between_brackets)
103
- }
104
- _ => None ,
97
+ match ( first_child. kind ( ) , last_child. kind ( ) ) {
98
+ ( T ! [ '(' ] , T ! [ ')' ] ) | ( T ! [ '[' ] , T ! [ ']' ] ) | ( T ! [ '{' ] , T ! [ '}' ] ) => {
99
+ Some ( contents_between_brackets)
105
100
}
101
+ _ => None ,
106
102
}
107
103
}
108
104
@@ -418,4 +414,9 @@ fn main() {
418
414
}"# ,
419
415
) ;
420
416
}
417
+
418
+ #[ test]
419
+ fn test_remove_empty_dbg ( ) {
420
+ check_assist ( remove_dbg, r#"$0dbg!()"# , r#""# ) ;
421
+ }
421
422
}
You can’t perform that action at this time.
0 commit comments