aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/hover.rs
diff options
context:
space:
mode:
authorHasan Ali <[email protected]>2020-05-15 22:23:49 +0100
committerHasan Ali <[email protected]>2020-05-16 01:09:04 +0100
commit001a86dc03104b75df732d69257d22526cf422b7 (patch)
tree4f1554da3d909c15d5e4cec7c8470687cf452467 /crates/ra_ide/src/hover.rs
parentcffa70be01d4353184f874fc4768b692e255dd30 (diff)
Fix completion and hover for module and function of same name
Diffstat (limited to 'crates/ra_ide/src/hover.rs')
-rw-r--r--crates/ra_ide/src/hover.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs
index 06d4f1c63..befa977c7 100644
--- a/crates/ra_ide/src/hover.rs
+++ b/crates/ra_ide/src/hover.rs
@@ -921,4 +921,21 @@ fn func(foo: i32) { if true { <|>foo; }; }
921 &["unsafe trait foo"], 921 &["unsafe trait foo"],
922 ); 922 );
923 } 923 }
924
925 #[test]
926 fn test_hover_mod_with_same_name_as_function() {
927 check_hover_result(
928 "
929 //- /lib.rs
930 use self::m<|>y::Bar;
931
932 mod my {
933 pub struct Bar;
934 }
935
936 fn my() {}
937 ",
938 &["mod my"],
939 );
940 }
924} 941}