Skip to content

Commit f6759ba

Browse files
committed
Add ignored test to demonstrate ImportMap bug
1 parent 6cae6b8 commit f6759ba

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

crates/ide/src/doc_links.rs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ mod tests {
439439

440440
fn check(ra_fixture: &str, expect: Expect) {
441441
let (analysis, position) = analysis_and_position(ra_fixture);
442-
let url = analysis.external_docs(position).unwrap().unwrap();
442+
let url = analysis.external_docs(position).unwrap().expect("could not find url for symbol");
443443

444444
expect.assert_eq(&url)
445445
}
@@ -517,4 +517,29 @@ pub struct Foo {
517517
expect![[r##"https://docs.rs/test/*/test/struct.Foo.html#structfield.field"##]],
518518
);
519519
}
520+
521+
// FIXME: ImportMap will return re-export paths instead of public module
522+
// paths. The correct path to documentation will never be a re-export.
523+
// This problem stops us from resolving stdlib items included in the prelude
524+
// such as `Option::Some` correctly.
525+
#[ignore = "ImportMap may return re-exports"]
526+
#[test]
527+
fn test_reexport_order() {
528+
check(
529+
r#"
530+
pub mod wrapper {
531+
pub use module::Item;
532+
533+
pub mod module {
534+
pub struct Item;
535+
}
536+
}
537+
538+
fn foo() {
539+
let bar: wrapper::It<|>em;
540+
}
541+
"#,
542+
expect![[r#"https://docs.rs/test/*/test/wrapper/module/struct.Item.html"#]],
543+
)
544+
}
520545
}

0 commit comments

Comments
 (0)