diff options
Diffstat (limited to 'crates/ra_ide/src/hover.rs')
-rw-r--r-- | crates/ra_ide/src/hover.rs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index befa977c7..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\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\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\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,8 +503,12 @@ fn main() { | |||
503 | "#, | 503 | "#, |
504 | &[" | 504 | &[" |
505 | Option | 505 | Option |
506 | ``` | ||
507 | |||
508 | ```rust | ||
506 | None | 509 | None |
507 | ``` | 510 | ``` |
511 | ___ | ||
508 | 512 | ||
509 | The None variant | 513 | The None variant |
510 | " | 514 | " |
@@ -524,8 +528,12 @@ The None variant | |||
524 | "#, | 528 | "#, |
525 | &[" | 529 | &[" |
526 | Option | 530 | Option |
531 | ``` | ||
532 | |||
533 | ```rust | ||
527 | Some | 534 | Some |
528 | ``` | 535 | ``` |
536 | ___ | ||
529 | 537 | ||
530 | The Some variant | 538 | The Some variant |
531 | " | 539 | " |
@@ -606,7 +614,10 @@ fn func(foo: i32) { if true { <|>foo; }; } | |||
606 | ", | 614 | ", |
607 | ); | 615 | ); |
608 | let hover = analysis.hover(position).unwrap().unwrap(); | 616 | let hover = analysis.hover(position).unwrap().unwrap(); |
609 | assert_eq!(trim_markup_opt(hover.info.first()), Some("wrapper::Thing\nfn new() -> Thing")); | 617 | assert_eq!( |
618 | trim_markup_opt(hover.info.first()), | ||
619 | Some("wrapper::Thing\n```\n\n```rust\nfn new() -> Thing") | ||
620 | ); | ||
610 | } | 621 | } |
611 | 622 | ||
612 | #[test] | 623 | #[test] |
@@ -882,7 +893,7 @@ fn func(foo: i32) { if true { <|>foo; }; } | |||
882 | fo<|>o(); | 893 | fo<|>o(); |
883 | } | 894 | } |
884 | ", | 895 | ", |
885 | &["fn foo()\n```\n\n<- `\u{3000}` here"], | 896 | &["fn foo()\n```\n___\n\n<- `\u{3000}` here"], |
886 | ); | 897 | ); |
887 | } | 898 | } |
888 | 899 | ||