File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -508,6 +508,37 @@ fn main() { }
508
508
) ;
509
509
}
510
510
511
+ #[ test]
512
+ fn hover_shows_fn_doc ( ) {
513
+ check (
514
+ r#"
515
+ /// # Example
516
+ /// ```
517
+ /// # use std::path::Path;
518
+ /// #
519
+ /// foo(Path::new("hello, world!"))
520
+ /// ```
521
+ pub fn foo<|>(_: &Path) {}
522
+
523
+ fn main() { }
524
+ "# ,
525
+ expect ! [ [ r#"
526
+ *foo*
527
+ ```rust
528
+ pub fn foo(_: &Path)
529
+ ```
530
+ ___
531
+
532
+ # Example
533
+ ```
534
+ # use std::path::Path;
535
+ #
536
+ foo(Path::new("hello, world!"))
537
+ ```
538
+ "# ] ] ,
539
+ ) ;
540
+ }
541
+
511
542
#[ test]
512
543
fn hover_shows_struct_field_info ( ) {
513
544
// Hovering over the field when instantiating
Original file line number Diff line number Diff line change @@ -755,7 +755,8 @@ pub(crate) fn runnable(
755
755
}
756
756
757
757
pub ( crate ) fn markup_content ( markup : Markup ) -> lsp_types:: MarkupContent {
758
- lsp_types:: MarkupContent { kind : lsp_types:: MarkupKind :: Markdown , value : markup. into ( ) }
758
+ let value = crate :: markdown:: format_docs ( markup. as_str ( ) ) ;
759
+ lsp_types:: MarkupContent { kind : lsp_types:: MarkupKind :: Markdown , value }
759
760
}
760
761
761
762
#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments