aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_ide/src/display.rs3
-rw-r--r--crates/ra_ide/src/hover.rs16
-rw-r--r--crates/rust-analyzer/tests/heavy_tests/main.rs2
3 files changed, 12 insertions, 9 deletions
diff --git a/crates/ra_ide/src/display.rs b/crates/ra_ide/src/display.rs
index 8bb312156..827c094e7 100644
--- a/crates/ra_ide/src/display.rs
+++ b/crates/ra_ide/src/display.rs
@@ -83,12 +83,13 @@ pub(crate) fn rust_code_markup_with_doc(
83 83
84 if let Some(mod_path) = mod_path { 84 if let Some(mod_path) = mod_path {
85 if !mod_path.is_empty() { 85 if !mod_path.is_empty() {
86 format_to!(buf, "{}\n___\n\n", mod_path); 86 format_to!(buf, "```rust\n{}\n```\n\n", mod_path);
87 } 87 }
88 } 88 }
89 format_to!(buf, "```rust\n{}\n```", code); 89 format_to!(buf, "```rust\n{}\n```", code);
90 90
91 if let Some(doc) = doc { 91 if let Some(doc) = doc {
92 format_to!(buf, "\n___");
92 format_to!(buf, "\n\n{}", doc); 93 format_to!(buf, "\n\n{}", doc);
93 } 94 }
94 95
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs
index 1f4f6b848..3e721dcca 100644
--- a/crates/ra_ide/src/hover.rs
+++ b/crates/ra_ide/src/hover.rs
@@ -405,7 +405,7 @@ mod tests {
405 }; 405 };
406 } 406 }
407 "#, 407 "#,
408 &["Foo\n___\n\n```rust\nfield_a: u32"], 408 &["Foo\n```\n\n```rust\nfield_a: u32"],
409 ); 409 );
410 410
411 // Hovering over the field in the definition 411 // Hovering over the field in the definition
@@ -422,7 +422,7 @@ mod tests {
422 }; 422 };
423 } 423 }
424 "#, 424 "#,
425 &["Foo\n___\n\n```rust\nfield_a: u32"], 425 &["Foo\n```\n\n```rust\nfield_a: u32"],
426 ); 426 );
427 } 427 }
428 428
@@ -475,7 +475,7 @@ fn main() {
475 ", 475 ",
476 ); 476 );
477 let hover = analysis.hover(position).unwrap().unwrap(); 477 let hover = analysis.hover(position).unwrap().unwrap();
478 assert_eq!(trim_markup_opt(hover.info.first()), Some("Option\n___\n\n```rust\nSome")); 478 assert_eq!(trim_markup_opt(hover.info.first()), Some("Option\n```\n\n```rust\nSome"));
479 479
480 let (analysis, position) = single_file_with_position( 480 let (analysis, position) = single_file_with_position(
481 " 481 "
@@ -503,11 +503,12 @@ fn main() {
503 "#, 503 "#,
504 &[" 504 &["
505Option 505Option
506___ 506```
507 507
508```rust 508```rust
509None 509None
510``` 510```
511___
511 512
512The None variant 513The None variant
513 " 514 "
@@ -527,11 +528,12 @@ The None variant
527 "#, 528 "#,
528 &[" 529 &["
529Option 530Option
530___ 531```
531 532
532```rust 533```rust
533Some 534Some
534``` 535```
536___
535 537
536The Some variant 538The Some variant
537 " 539 "
@@ -614,7 +616,7 @@ fn func(foo: i32) { if true { <|>foo; }; }
614 let hover = analysis.hover(position).unwrap().unwrap(); 616 let hover = analysis.hover(position).unwrap().unwrap();
615 assert_eq!( 617 assert_eq!(
616 trim_markup_opt(hover.info.first()), 618 trim_markup_opt(hover.info.first()),
617 Some("wrapper::Thing\n___\n\n```rust\nfn new() -> Thing") 619 Some("wrapper::Thing\n```\n\n```rust\nfn new() -> Thing")
618 ); 620 );
619 } 621 }
620 622
@@ -891,7 +893,7 @@ fn func(foo: i32) { if true { <|>foo; }; }
891 fo<|>o(); 893 fo<|>o();
892 } 894 }
893 ", 895 ",
894 &["fn foo()\n```\n\n<- `\u{3000}` here"], 896 &["fn foo()\n```\n___\n\n<- `\u{3000}` here"],
895 ); 897 );
896 } 898 }
897 899
diff --git a/crates/rust-analyzer/tests/heavy_tests/main.rs b/crates/rust-analyzer/tests/heavy_tests/main.rs
index b1bfc968a..405ddb362 100644
--- a/crates/rust-analyzer/tests/heavy_tests/main.rs
+++ b/crates/rust-analyzer/tests/heavy_tests/main.rs
@@ -756,5 +756,5 @@ pub fn foo(_input: TokenStream) -> TokenStream {
756 }); 756 });
757 757
758 let value = res.get("contents").unwrap().get("value").unwrap().to_string(); 758 let value = res.get("contents").unwrap().get("value").unwrap().to_string();
759 assert_eq!(value, r#""foo::Bar\n___\n\n```rust\nfn bar()\n```""#) 759 assert_eq!(value, r#""```rust\nfoo::Bar\n```\n\n```rust\nfn bar()\n```""#)
760} 760}