Add test for hover of macro expanded function

This commit is contained in:
oxalica 2021-03-14 01:07:05 +08:00
parent eec64ec01b
commit ef48d1ca3b
No known key found for this signature in database
GPG Key ID: CED392DE0C483D00

View File

@ -3657,4 +3657,42 @@ fn hover_builtin() {
"#]],
);
}
#[test]
fn hover_macro_expanded_function() {
check(
r#"
struct S<'a, T>(&'a T);
trait Clone {}
macro_rules! foo {
() => {
fn bar<'t, T: Clone + 't>(s: &mut S<'t, T>, t: u32) -> *mut u32 where
't: 't + 't,
for<'a> T: Clone + 'a
{ 0 as _ }
};
}
foo!();
fn main() {
bar$0;
}
"#,
expect![[r#"
*bar*
```rust
test
```
```rust
fn bar<'t, T: Clone + 't>(s: &mut S<'t, T>, t: u32) -> *mut u32
where
't: 't + 't,
for<'a> T: Clone + 'a,
```
"#]],
)
}
}