aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/references/rename.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/references/rename.rs')
-rw-r--r--crates/ide/src/references/rename.rs54
1 files changed, 54 insertions, 0 deletions
diff --git a/crates/ide/src/references/rename.rs b/crates/ide/src/references/rename.rs
index b3ade20ef..bc4aa25bf 100644
--- a/crates/ide/src/references/rename.rs
+++ b/crates/ide/src/references/rename.rs
@@ -1138,4 +1138,58 @@ fn foo(bar: i32) -> Foo {
1138"#, 1138"#,
1139 ); 1139 );
1140 } 1140 }
1141
1142 #[test]
1143 fn test_rename_binding_in_destructure_pat_shorthand() {
1144 check(
1145 "bar",
1146 r#"
1147struct Foo {
1148 i: i32,
1149}
1150
1151fn foo(foo: Foo) {
1152 let Foo { i } = foo;
1153 let _ = i<|>;
1154}
1155"#,
1156 r#"
1157struct Foo {
1158 i: i32,
1159}
1160
1161fn foo(foo: Foo) {
1162 let Foo { i: bar } = foo;
1163 let _ = bar;
1164}
1165"#,
1166 );
1167 }
1168
1169 #[test]
1170 fn test_rename_binding_in_destructure_pat() {
1171 check(
1172 "bar",
1173 r#"
1174struct Foo {
1175 i: i32,
1176}
1177
1178fn foo(foo: Foo) {
1179 let Foo { i: b } = foo;
1180 let _ = b<|>;
1181}
1182"#,
1183 r#"
1184struct Foo {
1185 i: i32,
1186}
1187
1188fn foo(foo: Foo) {
1189 let Foo { i: bar } = foo;
1190 let _ = bar;
1191}
1192"#,
1193 );
1194 }
1141} 1195}