Skip to content

Commit 60bdb2d

Browse files
committed
delete the whole ast::ExprStmt instead of just the dbg macro if the parent is an ExprStmt
1 parent 2ba82fd commit 60bdb2d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/ide-assists/src/handlers/remove_dbg.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ fn run_dbg_replacement(
9696
editor.delete(macro_expr.syntax());
9797
(range, None)
9898
},
99-
ast::ExprStmt(it) => {
100-
let range = it.syntax().text_range();
101-
let range = match whitespace_start(it.syntax().prev_sibling_or_token()) {
99+
ast::ExprStmt(_) => {
100+
let range = parent.text_range();
101+
let range = match whitespace_start(parent.prev_sibling_or_token()) {
102102
Some(start) => range.cover_offset(start),
103103
None => range,
104104
};

0 commit comments

Comments
 (0)