Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide_assists/src/handlers/remove_dbg.rs')
-rw-r--r--crates/ide_assists/src/handlers/remove_dbg.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/ide_assists/src/handlers/remove_dbg.rs b/crates/ide_assists/src/handlers/remove_dbg.rs
index b860a3b6da..07dcfd9671 100644
--- a/crates/ide_assists/src/handlers/remove_dbg.rs
+++ b/crates/ide_assists/src/handlers/remove_dbg.rs
@@ -36,9 +36,8 @@ pub(crate) fn remove_dbg(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
let input_expressions = input_expressions
.into_iter()
.filter_map(|(is_sep, group)| (!is_sep).then(|| group))
- .map(|mut tokens| ast::Expr::parse(&tokens.join("")))
- .collect::<Result<Vec<ast::Expr>, _>>()
- .ok()?;
+ .map(|mut tokens| syntax::hacks::parse_expr_from_str(&tokens.join("")))
+ .collect::<Option<Vec<ast::Expr>>>()?;
let parent = macro_call.syntax().parent()?;
let (range, text) = match &*input_expressions {