aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api_light/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api_light/src')
-rw-r--r--crates/ra_ide_api_light/src/assists/introduce_variable.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ra_ide_api_light/src/assists/introduce_variable.rs b/crates/ra_ide_api_light/src/assists/introduce_variable.rs
index 523ec7034..d5b7487e0 100644
--- a/crates/ra_ide_api_light/src/assists/introduce_variable.rs
+++ b/crates/ra_ide_api_light/src/assists/introduce_variable.rs
@@ -141,4 +141,21 @@ fn foo() {
141 ); 141 );
142 } 142 }
143 143
144 #[test]
145 fn test_introduce_var_block_expr_second_to_last() {
146 check_assist_range(
147 introduce_variable,
148 "
149fn foo() {
150 <|>{ let x = 0; x }<|>
151 something_else();
152}",
153 "
154fn foo() {
155 let <|>var_name = { let x = 0; x };
156 var_name
157 something_else();
158}",
159 );
160 }
144} 161}