aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-02-26 13:43:15 +0000
committerGitHub <[email protected]>2020-02-26 13:43:15 +0000
commit2dee0779e9977e4570122c42ac35c4183bb8e604 (patch)
tree27fb867641ee0c771ae230fc60eff8bb979dc295 /crates/ra_ide
parent9b11c183ed41676bce00e8550707b6552184f30b (diff)
parent871dc2bd3cec11f76a4ef93ac3438af80fb6e776 (diff)
Merge pull request #3314 from edwin0cheng/original-range-recursive
Add recursive macro support in `original_range`
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/hover.rs21
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 "