aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/hover.rs
diff options
context:
space:
mode:
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