mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Add recursive support in original_range
This commit is contained in:
parent
80f8e474a0
commit
ffdc740446
2 changed files with 58 additions and 14 deletions
|
@ -753,6 +753,27 @@ fn func(foo: i32) { if true { <|>foo; }; }
|
|||
assert_eq!(hover_on, "bar")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hover_through_expr_in_macro_recursive() {
|
||||
let hover_on = check_hover_result(
|
||||
"
|
||||
//- /lib.rs
|
||||
macro_rules! id_deep {
|
||||
($($tt:tt)*) => { $($tt)* }
|
||||
}
|
||||
macro_rules! id {
|
||||
($($tt:tt)*) => { id_deep!($($tt)*) }
|
||||
}
|
||||
fn foo(bar:u32) {
|
||||
let a = id!(ba<|>r);
|
||||
}
|
||||
",
|
||||
&["u32"],
|
||||
);
|
||||
|
||||
assert_eq!(hover_on, "bar")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hover_non_ascii_space_doc() {
|
||||
check_hover_result(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue