From dd0421e587bf312bd79eb98c821e0be437f6b361 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sun, 9 Feb 2020 17:17:56 +0800 Subject: Handle macro token cases for rename --- crates/ra_ide/src/references/rename.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'crates/ra_ide/src/references') 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 @@ -210,6 +210,25 @@ mod tests { ); } + #[test] + fn test_rename_for_macro_args() { + test_rename( + r#" + macro_rules! foo {($i:ident) => {$i} } + fn main() { + let a<|> = "test"; + foo!(a); + }"#, + "b", + r#" + macro_rules! foo {($i:ident) => {$i} } + fn main() { + let b = "test"; + foo!(b); + }"#, + ); + } + #[test] fn test_rename_for_param_inside() { test_rename( -- cgit v1.2.3