From 5734b347ddfff0d285d3eecf5735cac30271696c Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 17 Mar 2021 16:10:58 +0100 Subject: Fix incorrect newline emission in Attrs::docs --- crates/ide/src/hover.rs | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'crates/ide') diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index cc2b79124..15d309d7d 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs @@ -1533,12 +1533,21 @@ fn my() {} fn test_hover_struct_doc_comment() { check( r#" -/// bar docs +/// This is an example +/// multiline doc +/// +/// # Example +/// +/// ``` +/// let five = 5; +/// +/// assert_eq!(6, my_crate::add_one(5)); +/// ``` struct Bar; fn foo() { let bar = Ba$0r; } "#, - expect![[r#" + expect![[r##" *Bar* ```rust @@ -1551,8 +1560,17 @@ fn foo() { let bar = Ba$0r; } --- - bar docs - "#]], + This is an example + multiline doc + + # Example + + ``` + let five = 5; + + assert_eq!(6, my_crate::add_one(5)); + ``` + "##]], ); } -- cgit v1.2.3