diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-22 12:29:42 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-22 12:29:42 +0000 |
commit | 1b96c79ab5bb3eae373e3392695d3578ed4bbf59 (patch) | |
tree | ba7ff996fac0eff137cc8248b2a722f809ba4cc1 /crates/ide/src/hover.rs | |
parent | 3cd994d8a50da568ca66f69b92ee48397aa7a179 (diff) | |
parent | f5b97e52c97fe6cc12aba3587c12e37b403deea4 (diff) |
Merge #7348
7348: Fix broken link in intra-doc r=edwin0cheng a=sasurau4
Fix #5546
The intra-doc link doesn't work fine for trait associated method.
Co-authored-by: Daiki Ihara <[email protected]>
Diffstat (limited to 'crates/ide/src/hover.rs')
-rw-r--r-- | crates/ide/src/hover.rs | 29 |
1 files changed, 29 insertions, 0 deletions
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 | |||
1826 | "#]], | 1826 | "#]], |
1827 | ); | 1827 | ); |
1828 | } | 1828 | } |
1829 | #[test] | ||
1830 | fn test_hover_intra_link_reference_to_trait_method() { | ||
1831 | check( | ||
1832 | r#" | ||
1833 | pub trait Foo { | ||
1834 | fn buzz() -> usize; | ||
1835 | } | ||
1836 | /// [Foo][buzz] | ||
1837 | /// | ||
1838 | /// [buzz]: Foo::buzz | ||
1839 | pub struct B$0ar | ||
1840 | "#, | ||
1841 | expect![[r#" | ||
1842 | *Bar* | ||
1843 | |||
1844 | ```rust | ||
1845 | test | ||
1846 | ``` | ||
1847 | |||
1848 | ```rust | ||
1849 | pub struct Bar | ||
1850 | ``` | ||
1851 | |||
1852 | --- | ||
1853 | |||
1854 | [Foo](https://docs.rs/test/*/test/trait.Foo.html#tymethod.buzz) | ||
1855 | "#]], | ||
1856 | ); | ||
1857 | } | ||
1829 | 1858 | ||
1830 | #[test] | 1859 | #[test] |
1831 | fn test_hover_external_url() { | 1860 | fn test_hover_external_url() { |