mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Simpilfy origin_range logic
This commit is contained in:
parent
3e25b17cfd
commit
7a5ff0f37c
2 changed files with 51 additions and 38 deletions
|
@ -738,6 +738,30 @@ fn func(foo: i32) { if true { <|>foo; }; }
|
|||
assert_eq!(hover_on, "bar")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hover_through_func_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 bar() -> u32 {
|
||||
0
|
||||
}
|
||||
fn foo() {
|
||||
let a = id!([0u32, bar(<|>)] );
|
||||
}
|
||||
",
|
||||
&["u32"],
|
||||
);
|
||||
|
||||
assert_eq!(hover_on, "bar()")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hover_through_literal_string_in_macro() {
|
||||
let hover_on = check_hover_result(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue