From f6759ba3bbc2c17771735327238c4ed936d5cdc9 Mon Sep 17 00:00:00 2001 From: Zac Pullar-Strecker Date: Sat, 5 Sep 2020 17:21:52 +1200 Subject: Add ignored test to demonstrate ImportMap bug --- crates/ide/src/doc_links.rs | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'crates/ide/src') diff --git a/crates/ide/src/doc_links.rs b/crates/ide/src/doc_links.rs index 101466014..164783e14 100644 --- a/crates/ide/src/doc_links.rs +++ b/crates/ide/src/doc_links.rs @@ -439,7 +439,7 @@ mod tests { fn check(ra_fixture: &str, expect: Expect) { let (analysis, position) = analysis_and_position(ra_fixture); - let url = analysis.external_docs(position).unwrap().unwrap(); + let url = analysis.external_docs(position).unwrap().expect("could not find url for symbol"); expect.assert_eq(&url) } @@ -517,4 +517,29 @@ pub struct Foo { expect![[r##"https://docs.rs/test/*/test/struct.Foo.html#structfield.field"##]], ); } + + // 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() { + check( + r#" +pub mod wrapper { + pub use module::Item; + + pub mod module { + pub struct Item; + } +} + +fn foo() { + let bar: wrapper::It<|>em; +} + "#, + expect![[r#"https://docs.rs/test/*/test/wrapper/module/struct.Item.html"#]], + ) + } } -- cgit v1.2.3