aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroxalica <[email protected]>2021-03-13 17:07:05 +0000
committeroxalica <[email protected]>2021-03-15 17:01:24 +0000
commitef48d1ca3bfb512c245d9e9bdc73d0d5a5f79740 (patch)
tree15e6ee601e101f61f05d51d3ed2cec5b0bf9a9b0
parenteec64ec01b0553aca855df8146965ed6c6746e7d (diff)
Add test for hover of macro expanded function
-rw-r--r--crates/ide/src/hover.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
index ea45086ce..f872b68cf 100644
--- a/crates/ide/src/hover.rs
+++ b/crates/ide/src/hover.rs
@@ -3657,4 +3657,42 @@ cosnt _: &str$0 = ""; }"#;
3657 "#]], 3657 "#]],
3658 ); 3658 );
3659 } 3659 }
3660
3661 #[test]
3662 fn hover_macro_expanded_function() {
3663 check(
3664 r#"
3665struct S<'a, T>(&'a T);
3666trait Clone {}
3667macro_rules! foo {
3668 () => {
3669 fn bar<'t, T: Clone + 't>(s: &mut S<'t, T>, t: u32) -> *mut u32 where
3670 't: 't + 't,
3671 for<'a> T: Clone + 'a
3672 { 0 as _ }
3673 };
3674}
3675
3676foo!();
3677
3678fn main() {
3679 bar$0;
3680}
3681"#,
3682 expect![[r#"
3683 *bar*
3684
3685 ```rust
3686 test
3687 ```
3688
3689 ```rust
3690 fn bar<'t, T: Clone + 't>(s: &mut S<'t, T>, t: u32) -> *mut u32
3691 where
3692 't: 't + 't,
3693 for<'a> T: Clone + 'a,
3694 ```
3695 "#]],
3696 )
3697 }
3660} 3698}