diff options
author | Edwin Cheng <[email protected]> | 2020-02-26 04:27:57 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2020-02-26 12:53:00 +0000 |
commit | ffdc740446585502bd179cb608a033dd74a41e39 (patch) | |
tree | 2ae365b1556c2e666669991a8aaffa362e0c2598 /crates/ra_ide | |
parent | 80f8e474a0c6a1cf477afc2141f9d6182f8b05a3 (diff) |
Add recursive support in original_range
Diffstat (limited to 'crates/ra_ide')
-rw-r--r-- | crates/ra_ide/src/hover.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index ace33c079..29b16e602 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs | |||
@@ -754,6 +754,27 @@ fn func(foo: i32) { if true { <|>foo; }; } | |||
754 | } | 754 | } |
755 | 755 | ||
756 | #[test] | 756 | #[test] |
757 | fn test_hover_through_expr_in_macro_recursive() { | ||
758 | let hover_on = check_hover_result( | ||
759 | " | ||
760 | //- /lib.rs | ||
761 | macro_rules! id_deep { | ||
762 | ($($tt:tt)*) => { $($tt)* } | ||
763 | } | ||
764 | macro_rules! id { | ||
765 | ($($tt:tt)*) => { id_deep!($($tt)*) } | ||
766 | } | ||
767 | fn foo(bar:u32) { | ||
768 | let a = id!(ba<|>r); | ||
769 | } | ||
770 | ", | ||
771 | &["u32"], | ||
772 | ); | ||
773 | |||
774 | assert_eq!(hover_on, "bar") | ||
775 | } | ||
776 | |||
777 | #[test] | ||
757 | fn test_hover_non_ascii_space_doc() { | 778 | fn test_hover_non_ascii_space_doc() { |
758 | check_hover_result( | 779 | check_hover_result( |
759 | " | 780 | " |