mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Fix rename trying to edit the same range multiple times
This commit is contained in:
parent
745fd9903c
commit
86e5406539
2 changed files with 55 additions and 7 deletions
|
@ -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,
|
||||
}
|
||||
};
|
||||
}
|
||||
"#,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue