aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/handlers/introduce_variable.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/handlers/introduce_variable.rs')
-rw-r--r--crates/ra_assists/src/handlers/introduce_variable.rs20
1 files changed, 12 insertions, 8 deletions
diff --git a/crates/ra_assists/src/handlers/introduce_variable.rs b/crates/ra_assists/src/handlers/introduce_variable.rs
index 31d6539f7..88b62278f 100644
--- a/crates/ra_assists/src/handlers/introduce_variable.rs
+++ b/crates/ra_assists/src/handlers/introduce_variable.rs
@@ -226,27 +226,31 @@ fn foo() {
226 mark::check!(test_introduce_var_last_expr); 226 mark::check!(test_introduce_var_last_expr);
227 check_assist( 227 check_assist(
228 introduce_variable, 228 introduce_variable,
229 " 229 r#"
230fn foo() { 230fn foo() {
231 bar(<|>1 + 1<|>) 231 bar(<|>1 + 1<|>)
232}", 232}
233 " 233"#,
234 r#"
234fn foo() { 235fn foo() {
235 let $0var_name = 1 + 1; 236 let $0var_name = 1 + 1;
236 bar(var_name) 237 bar(var_name)
237}", 238}
239"#,
238 ); 240 );
239 check_assist( 241 check_assist(
240 introduce_variable, 242 introduce_variable,
241 " 243 r#"
242fn foo() { 244fn foo() {
243 <|>bar(1 + 1)<|> 245 <|>bar(1 + 1)<|>
244}", 246}
245 " 247"#,
248 r#"
246fn foo() { 249fn foo() {
247 let $0var_name = bar(1 + 1); 250 let $0var_name = bar(1 + 1);
248 var_name 251 var_name
249}", 252}
253"#,
250 ) 254 )
251 } 255 }
252 256