From 3f2bc813d3b91fbf8a0007eb11c192061571873b Mon Sep 17 00:00:00 2001 From: JmPotato Date: Sun, 9 Aug 2020 21:33:14 +0800 Subject: format in to_proto::markup_content Signed-off-by: JmPotato --- crates/ra_ide/src/hover.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'crates/ra_ide') diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index aa48cb412..385e3e64e 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs @@ -508,6 +508,37 @@ fn main() { } ); } + #[test] + fn hover_shows_fn_doc() { + check( + r#" +/// # Example +/// ``` +/// # use std::path::Path; +/// # +/// foo(Path::new("hello, world!")) +/// ``` +pub fn foo<|>(_: &Path) {} + +fn main() { } +"#, + expect![[r#" + *foo* + ```rust + pub fn foo(_: &Path) + ``` + ___ + + # Example + ``` + # use std::path::Path; + # + foo(Path::new("hello, world!")) + ``` + "#]], + ); + } + #[test] fn hover_shows_struct_field_info() { // Hovering over the field when instantiating -- cgit v1.2.3