]> git.lizzy.rs Git - rust.git/blobdiff - crates/ide/src/hover.rs
internal: retire famous_defs_fixture
[rust.git] / crates / ide / src / hover.rs
index c08516805e151a525508f21797ecd6e410836784..409f81ca09f6669f546ef372b73bfaab2d96128f 100644 (file)
@@ -568,8 +568,6 @@ mod tests {
 
     use crate::fixture;
 
-    use super::*;
-
     fn check_hover_no_result(ra_fixture: &str) {
         let (analysis, position) = fixture::position(ra_fixture);
         assert!(analysis.hover(position, true, true).unwrap().is_none());
@@ -1821,9 +1819,10 @@ pub struct Bar
         );
     }
 
-    #[ignore = "path based links currently only support documentation on ModuleDef items"]
     #[test]
     fn test_hover_path_link_field() {
+        // FIXME: Should be
+        //  [Foo](https://docs.rs/test/*/test/struct.Foo.html)
         check(
             r#"
 pub struct Foo;
@@ -1845,7 +1844,7 @@ pub struct Bar {
 
                 ---
 
-                [Foo](https://docs.rs/test/*/test/struct.Foo.html)
+                [Foo](struct.Foo.html)
             "#]],
         );
     }
@@ -2999,29 +2998,24 @@ fn foo(ar$0g: &impl Foo + Bar<S>) {}
     fn test_hover_async_block_impl_trait_has_goto_type_action() {
         check_actions(
             r#"
+//- minicore: future
 struct S;
 fn foo() {
     let fo$0o = async { S };
 }
-
-#[prelude_import] use future::*;
-mod future {
-    #[lang = "future_trait"]
-    pub trait Future { type Output; }
-}
 "#,
             expect![[r#"
                 [
                     GoToType(
                         [
                             HoverGotoTypeData {
-                                mod_path: "test::future::Future",
+                                mod_path: "core::future::Future",
                                 nav: NavigationTarget {
                                     file_id: FileId(
-                                        0,
+                                        1,
                                     ),
-                                    full_range: 101..163,
-                                    focus_range: 140..146,
+                                    full_range: 248..430,
+                                    focus_range: 287..293,
                                     name: "Future",
                                     kind: Trait,
                                     description: "pub trait Future",
@@ -3817,11 +3811,14 @@ mod bar
 
     #[test]
     fn hover_keyword() {
-        let ra_fixture = r#"//- /main.rs crate:main deps:std
-fn f() { retur$0n; }"#;
-        let fixture = format!("{}\n{}", ra_fixture, FamousDefs::FIXTURE);
         check(
-            &fixture,
+            r#"
+//- /main.rs crate:main deps:std
+fn f() { retur$0n; }
+//- /libstd.rs crate:std
+/// Docs for return_keyword
+mod return_keyword {}
+"#,
             expect![[r#"
                 *return*
 
@@ -3838,11 +3835,15 @@ fn hover_keyword() {
 
     #[test]
     fn hover_builtin() {
-        let ra_fixture = r#"//- /main.rs crate:main deps:std
-cosnt _: &str$0 = ""; }"#;
-        let fixture = format!("{}\n{}", ra_fixture, FamousDefs::FIXTURE);
         check(
-            &fixture,
+            r#"
+//- /main.rs crate:main deps:std
+cosnt _: &str$0 = ""; }
+
+//- /libstd.rs crate:std
+/// Docs for prim_str
+mod prim_str {}
+"#,
             expect![[r#"
                 *str*