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(
9494 let mut contents_between_brackets = children_with_tokens. collect :: < Vec < _ > > ( ) ;
9595 let last_child = contents_between_brackets. pop ( ) ?;
9696
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)
105100 }
101+ _ => None ,
106102 }
107103}
108104
@@ -418,4 +414,9 @@ fn main() {
418414}"# ,
419415 ) ;
420416 }
417+
418+ #[ test]
419+ fn test_remove_empty_dbg ( ) {
420+ check_assist ( remove_dbg, r#"$0dbg!()"# , r#""# ) ;
421+ }
421422}
You can’t perform that action at this time.
0 commit comments