From f5b97e52c97fe6cc12aba3587c12e37b403deea4 Mon Sep 17 00:00:00 2001 From: Daiki Ihara Date: Wed, 20 Jan 2021 00:43:06 +0900 Subject: Fix broken link in intra-doc --- crates/ide/src/hover.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'crates/ide/src/hover.rs') diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index ec1631486..d47a4cb0f 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs @@ -1826,6 +1826,35 @@ pub struct B$0ar "#]], ); } + #[test] + fn test_hover_intra_link_reference_to_trait_method() { + check( + r#" +pub trait Foo { + fn buzz() -> usize; +} +/// [Foo][buzz] +/// +/// [buzz]: Foo::buzz +pub struct B$0ar +"#, + expect![[r#" + *Bar* + + ```rust + test + ``` + + ```rust + pub struct Bar + ``` + + --- + + [Foo](https://docs.rs/test/*/test/trait.Foo.html#tymethod.buzz) + "#]], + ); + } #[test] fn test_hover_external_url() { -- cgit v1.2.3