Don't bother with focus range for navigation to locals

This commit is contained in:
Aleksey Kladov 2019-12-18 16:25:15 +01:00
parent 46a299bcee
commit 7c25224f05
2 changed files with 49 additions and 7 deletions

View file

@ -817,4 +817,45 @@ mod tests {
"T",
);
}
#[test]
fn goto_within_macro() {
check_goto(
"
//- /lib.rs
macro_rules! id {
($($tt:tt)*) => ($($tt)*)
}
fn foo() {
let x = 1;
id!({
let y = <|>x;
let z = y;
});
}
",
"x BIND_PAT FileId(1) [69; 70)",
"x",
);
check_goto(
"
//- /lib.rs
macro_rules! id {
($($tt:tt)*) => ($($tt)*)
}
fn foo() {
let x = 1;
id!({
let y = x;
let z = <|>y;
});
}
",
"y BIND_PAT FileId(1) [98; 99)",
"y",
);
}
}