Fix rename trying to edit the same range multiple times

This commit is contained in:
Lukas Wirth 2021-10-02 18:50:21 +02:00
parent 745fd9903c
commit 86e5406539
2 changed files with 55 additions and 7 deletions

View file

@ -1899,6 +1899,51 @@ fn func$0() {
fn function() {
function();
}
"#,
)
}
#[test]
fn in_macro_multi_mapping() {
check(
"a",
r#"
fn foo() {
macro_rules! match_ast2 {
($node:ident {
$( $res:expr, )*
}) => {{
$( if $node { $res } else )*
{ loop {} }
}};
}
let $0d = 3;
match_ast2! {
d {
d,
d,
}
};
}
"#,
r#"
fn foo() {
macro_rules! match_ast2 {
($node:ident {
$( $res:expr, )*
}) => {{
$( if $node { $res } else )*
{ loop {} }
}};
}
let a = 3;
match_ast2! {
a {
a,
a,
}
};
}
"#,
)
}