diff options
Diffstat (limited to 'crates/ra_ide/src/hover.rs')
-rw-r--r-- | crates/ra_ide/src/hover.rs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index 58c799eca..54d318858 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs | |||
@@ -844,4 +844,40 @@ fn func(foo: i32) { if true { <|>foo; }; } | |||
844 | &["fn foo()\n```\n\n<- `\u{3000}` here"], | 844 | &["fn foo()\n```\n\n<- `\u{3000}` here"], |
845 | ); | 845 | ); |
846 | } | 846 | } |
847 | |||
848 | #[test] | ||
849 | fn test_hover_function_show_qualifiers() { | ||
850 | check_hover_result( | ||
851 | " | ||
852 | //- /lib.rs | ||
853 | async fn foo<|>() {} | ||
854 | ", | ||
855 | &["async fn foo()"], | ||
856 | ); | ||
857 | check_hover_result( | ||
858 | " | ||
859 | //- /lib.rs | ||
860 | pub const unsafe fn foo<|>() {} | ||
861 | ", | ||
862 | &["pub const unsafe fn foo()"], | ||
863 | ); | ||
864 | check_hover_result( | ||
865 | r#" | ||
866 | //- /lib.rs | ||
867 | pub(crate) async unsafe extern "C" fn foo<|>() {} | ||
868 | "#, | ||
869 | &[r#"pub(crate) async unsafe extern "C" fn foo()"#], | ||
870 | ); | ||
871 | } | ||
872 | |||
873 | #[test] | ||
874 | fn test_hover_trait_show_qualifiers() { | ||
875 | check_hover_result( | ||
876 | " | ||
877 | //- /lib.rs | ||
878 | unsafe trait foo<|>() {} | ||
879 | ", | ||
880 | &["unsafe trait foo"], | ||
881 | ); | ||
882 | } | ||
847 | } | 883 | } |