diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-11 15:46:05 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-11 15:46:05 +0000 |
commit | 305d9219823f5c0a6ffe526351b225b410702dfd (patch) | |
tree | 160c211d7286da1aa6ed1b8ee4b1e099ffb4e3c3 /crates/ra_ide/src/references | |
parent | 3c98681d4efeabe91dc91ff3ef0e1ce11c35d067 (diff) | |
parent | 3038470c68e21e0d2aac079523955295ee54cb1a (diff) |
Merge #3064
3064: Handle macro token cases for rename r=matklad a=edwin0cheng
Fixes #2957
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/references')
-rw-r--r-- | crates/ra_ide/src/references/rename.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/ra_ide/src/references/rename.rs b/crates/ra_ide/src/references/rename.rs index 08e77c01f..c46b78cb6 100644 --- a/crates/ra_ide/src/references/rename.rs +++ b/crates/ra_ide/src/references/rename.rs | |||
@@ -211,6 +211,25 @@ mod tests { | |||
211 | } | 211 | } |
212 | 212 | ||
213 | #[test] | 213 | #[test] |
214 | fn test_rename_for_macro_args() { | ||
215 | test_rename( | ||
216 | r#" | ||
217 | macro_rules! foo {($i:ident) => {$i} } | ||
218 | fn main() { | ||
219 | let a<|> = "test"; | ||
220 | foo!(a); | ||
221 | }"#, | ||
222 | "b", | ||
223 | r#" | ||
224 | macro_rules! foo {($i:ident) => {$i} } | ||
225 | fn main() { | ||
226 | let b = "test"; | ||
227 | foo!(b); | ||
228 | }"#, | ||
229 | ); | ||
230 | } | ||
231 | |||
232 | #[test] | ||
214 | fn test_rename_for_param_inside() { | 233 | fn test_rename_for_param_inside() { |
215 | test_rename( | 234 | test_rename( |
216 | r#" | 235 | r#" |