From 3f4ad44082abe7256825f6fc692c1455a1eb28bb Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 14 Jun 2021 22:55:05 +0300 Subject: internal: document that we don't #[ignore] tests --- crates/ide/src/doc_links.rs | 18 ++++++++++++------ crates/ide/src/hover.rs | 5 +++-- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'crates/ide/src') diff --git a/crates/ide/src/doc_links.rs b/crates/ide/src/doc_links.rs index 57ae9455b..7ac0118fe 100644 --- a/crates/ide/src/doc_links.rs +++ b/crates/ide/src/doc_links.rs @@ -241,6 +241,10 @@ fn get_doc_link(db: &RootDatabase, definition: Definition) -> Option { Definition::ModuleDef(ModuleDef::Module(module)) => module.krate(), _ => definition.module(db)?.krate(), }; + // FIXME: using import map doesn't make sense here. What we want here is + // canonical path. What import map returns is the shortest path suitable for + // import. See this test: + cov_mark::hit!(test_reexport_order); let import_map = db.import_map(krate.into()); let mut base = krate.display_name(db)?.to_string(); @@ -642,13 +646,15 @@ pub mod foo { ) } - // FIXME: ImportMap will return re-export paths instead of public module - // paths. The correct path to documentation will never be a re-export. - // This problem stops us from resolving stdlib items included in the prelude - // such as `Option::Some` correctly. - #[ignore = "ImportMap may return re-exports"] #[test] fn test_reexport_order() { + cov_mark::check!(test_reexport_order); + // FIXME: This should return + // + // https://docs.rs/test/*/test/wrapper/modulestruct.Item.html + // + // That is, we should point inside the module, rather than at the + // re-export. check( r#" pub mod wrapper { @@ -663,7 +669,7 @@ fn foo() { let bar: wrapper::It$0em; } "#, - expect![[r#"https://docs.rs/test/*/test/wrapper/module/struct.Item.html"#]], + expect![[r#"https://docs.rs/test/*/test/wrapper/struct.Item.html"#]], ) } } diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index c08516805..afeded315 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs @@ -1821,9 +1821,10 @@ pub struct B$0ar ); } - #[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 +1846,7 @@ pub struct Bar { --- - [Foo](https://docs.rs/test/*/test/struct.Foo.html) + [Foo](struct.Foo.html) "#]], ); } -- cgit v1.2.3