aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/hover.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-08-26 19:26:07 +0100
committerGitHub <[email protected]>2020-08-26 19:26:07 +0100
commite7da5816d67fadc056ee43310f9d04164c2617d9 (patch)
tree854e94856b4d120d156b67e790d7f2ba74e14610 /crates/ide/src/hover.rs
parent7e012ae8b54705bc254154cdff3a503cce3299a7 (diff)
parentf8a59adf5e9633aa5d10efcdbf70b408d280ef01 (diff)
Merge #5895
5895: Tease apart orthogonal concerns in markdown link rewriting r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ide/src/hover.rs')
-rw-r--r--crates/ide/src/hover.rs54
1 files changed, 54 insertions, 0 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
index 536411704..efec0184e 100644
--- a/crates/ide/src/hover.rs
+++ b/crates/ide/src/hover.rs
@@ -1756,6 +1756,60 @@ pub struct B<|>ar
1756 } 1756 }
1757 1757
1758 #[test] 1758 #[test]
1759 fn test_doc_links_enum_variant() {
1760 check(
1761 r#"
1762enum E {
1763 /// [E]
1764 V<|> { field: i32 }
1765}
1766"#,
1767 expect![[r#"
1768 *V*
1769
1770 ```rust
1771 test::E
1772 ```
1773
1774 ```rust
1775 V
1776 ```
1777
1778 ---
1779
1780 [E](https://docs.rs/test/*/test/enum.E.html)
1781 "#]],
1782 );
1783 }
1784
1785 #[test]
1786 fn test_doc_links_field() {
1787 check(
1788 r#"
1789struct S {
1790 /// [`S`]
1791 field<|>: i32
1792}
1793"#,
1794 expect![[r#"
1795 *field*
1796
1797 ```rust
1798 test::S
1799 ```
1800
1801 ```rust
1802 field: i32
1803 ```
1804
1805 ---
1806
1807 [`S`](https://docs.rs/test/*/test/struct.S.html)
1808 "#]],
1809 );
1810 }
1811
1812 #[test]
1759 fn test_hover_macro_generated_struct_fn_doc_comment() { 1813 fn test_hover_macro_generated_struct_fn_doc_comment() {
1760 mark::check!(hover_macro_generated_struct_fn_doc_comment); 1814 mark::check!(hover_macro_generated_struct_fn_doc_comment);
1761 1815