aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/hover.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/hover.rs')
-rw-r--r--crates/ide/src/hover.rs29
1 files changed, 17 insertions, 12 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
index 01dd0c0da..05a2b1293 100644
--- a/crates/ide/src/hover.rs
+++ b/crates/ide/src/hover.rs
@@ -568,8 +568,6 @@ mod tests {
568 568
569 use crate::fixture; 569 use crate::fixture;
570 570
571 use super::*;
572
573 fn check_hover_no_result(ra_fixture: &str) { 571 fn check_hover_no_result(ra_fixture: &str) {
574 let (analysis, position) = fixture::position(ra_fixture); 572 let (analysis, position) = fixture::position(ra_fixture);
575 assert!(analysis.hover(position, true, true).unwrap().is_none()); 573 assert!(analysis.hover(position, true, true).unwrap().is_none());
@@ -3016,8 +3014,8 @@ fn foo() {
3016 file_id: FileId( 3014 file_id: FileId(
3017 1, 3015 1,
3018 ), 3016 ),
3019 full_range: 247..429, 3017 full_range: 251..433,
3020 focus_range: 286..292, 3018 focus_range: 290..296,
3021 name: "Future", 3019 name: "Future",
3022 kind: Trait, 3020 kind: Trait,
3023 description: "pub trait Future", 3021 description: "pub trait Future",
@@ -3813,11 +3811,14 @@ use foo::bar::{self$0};
3813 3811
3814 #[test] 3812 #[test]
3815 fn hover_keyword() { 3813 fn hover_keyword() {
3816 let ra_fixture = r#"//- /main.rs crate:main deps:std
3817fn f() { retur$0n; }"#;
3818 let fixture = format!("{}\n{}", ra_fixture, FamousDefs::FIXTURE);
3819 check( 3814 check(
3820 &fixture, 3815 r#"
3816//- /main.rs crate:main deps:std
3817fn f() { retur$0n; }
3818//- /libstd.rs crate:std
3819/// Docs for return_keyword
3820mod return_keyword {}
3821"#,
3821 expect![[r#" 3822 expect![[r#"
3822 *return* 3823 *return*
3823 3824
@@ -3834,11 +3835,15 @@ fn f() { retur$0n; }"#;
3834 3835
3835 #[test] 3836 #[test]
3836 fn hover_builtin() { 3837 fn hover_builtin() {
3837 let ra_fixture = r#"//- /main.rs crate:main deps:std
3838cosnt _: &str$0 = ""; }"#;
3839 let fixture = format!("{}\n{}", ra_fixture, FamousDefs::FIXTURE);
3840 check( 3838 check(
3841 &fixture, 3839 r#"
3840//- /main.rs crate:main deps:std
3841cosnt _: &str$0 = ""; }
3842
3843//- /libstd.rs crate:std
3844/// Docs for prim_str
3845mod prim_str {}
3846"#,
3842 expect![[r#" 3847 expect![[r#"
3843 *str* 3848 *str*
3844 3849