Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-assists/src/handlers/extract_expressions_from_format_string.rs')
-rw-r--r--crates/ide-assists/src/handlers/extract_expressions_from_format_string.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/crates/ide-assists/src/handlers/extract_expressions_from_format_string.rs b/crates/ide-assists/src/handlers/extract_expressions_from_format_string.rs
index 9d72d3af09..2725a97de8 100644
--- a/crates/ide-assists/src/handlers/extract_expressions_from_format_string.rs
+++ b/crates/ide-assists/src/handlers/extract_expressions_from_format_string.rs
@@ -274,4 +274,22 @@ fn main() {
"#,
);
}
+
+ #[test]
+ fn escaped_literals() {
+ check_assist(
+ extract_expressions_from_format_string,
+ r#"
+//- minicore: fmt
+fn main() {
+ print!("\n$ {x + 1}$0");
+}
+ "#,
+ r#"
+fn main() {
+ print!("\n$ {}"$0, x + 1);
+}
+ "#,
+ );
+ }
}