aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2020-02-28 14:53:59 +0000
committerEdwin Cheng <[email protected]>2020-02-28 14:53:59 +0000
commit7a5ff0f37c5fb7d1d21ee56da0168f68e54fbca5 (patch)
tree50fd6510b35d89967ae6e449a69fcbc6fc0233cd /crates/ra_ide
parent3e25b17cfd0bd9bbd741ca6cf16ab39089910a74 (diff)
Simpilfy origin_range logic
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/hover.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs
index 7ba4bfcac..cc79f1fab 100644
--- a/crates/ra_ide/src/hover.rs
+++ b/crates/ra_ide/src/hover.rs
@@ -739,6 +739,30 @@ fn func(foo: i32) { if true { <|>foo; }; }
739 } 739 }
740 740
741 #[test] 741 #[test]
742 fn test_hover_through_func_in_macro_recursive() {
743 let hover_on = check_hover_result(
744 "
745 //- /lib.rs
746 macro_rules! id_deep {
747 ($($tt:tt)*) => { $($tt)* }
748 }
749 macro_rules! id {
750 ($($tt:tt)*) => { id_deep!($($tt)*) }
751 }
752 fn bar() -> u32 {
753 0
754 }
755 fn foo() {
756 let a = id!([0u32, bar(<|>)] );
757 }
758 ",
759 &["u32"],
760 );
761
762 assert_eq!(hover_on, "bar()")
763 }
764
765 #[test]
742 fn test_hover_through_literal_string_in_macro() { 766 fn test_hover_through_literal_string_in_macro() {
743 let hover_on = check_hover_result( 767 let hover_on = check_hover_result(
744 r#" 768 r#"