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 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'crates/ide/src/doc_links.rs') 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"#]], ) } } -- cgit v1.2.3