diff options
Diffstat (limited to 'crates/ide')
-rw-r--r-- | crates/ide/src/doc_links.rs | 27 |
1 files changed, 26 insertions, 1 deletions
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 { | |||
439 | 439 | ||
440 | fn check(ra_fixture: &str, expect: Expect) { | 440 | fn check(ra_fixture: &str, expect: Expect) { |
441 | let (analysis, position) = analysis_and_position(ra_fixture); | 441 | 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"); |
443 | 443 | ||
444 | expect.assert_eq(&url) | 444 | expect.assert_eq(&url) |
445 | } | 445 | } |
@@ -517,4 +517,29 @@ pub struct Foo { | |||
517 | expect![[r##"https://docs.rs/test/*/test/struct.Foo.html#structfield.field"##]], | 517 | expect![[r##"https://docs.rs/test/*/test/struct.Foo.html#structfield.field"##]], |
518 | ); | 518 | ); |
519 | } | 519 | } |
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 | } | ||
520 | } | 545 | } |