format in to_proto::markup_content
Signed-off-by: JmPotato <ghzpotato@gmail.com>
This commit is contained in:
parent
8a57afe5a4
commit
3f2bc813d3
@ -508,6 +508,37 @@ pub fn foo(a: u32, b: u32) -> u32
|
||||
);
|
||||
}
|
||||
|
||||
#[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
|
||||
|
@ -755,7 +755,8 @@ pub(crate) fn runnable(
|
||||
}
|
||||
|
||||
pub(crate) fn markup_content(markup: Markup) -> lsp_types::MarkupContent {
|
||||
lsp_types::MarkupContent { kind: lsp_types::MarkupKind::Markdown, value: markup.into() }
|
||||
let value = crate::markdown::format_docs(markup.as_str());
|
||||
lsp_types::MarkupContent { kind: lsp_types::MarkupKind::Markdown, value }
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
Loading…
Reference in New Issue
Block a user