mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Fix documentation of snippet
This commit is contained in:
parent
0f8c96c926
commit
01b3ce3006
2 changed files with 26 additions and 5 deletions
|
@ -1364,7 +1364,23 @@ fn manual(fields: &[(&'static str, &'static str, &[&str], &str)]) -> String {
|
|||
.map(|(field, _ty, doc, default)| {
|
||||
let name = format!("rust-analyzer.{}", field.replace("_", "."));
|
||||
let doc = doc_comment_to_string(*doc);
|
||||
format!("[[{}]]{} (default: `{}`)::\n+\n--\n{}--\n", name, name, default, doc)
|
||||
if default.contains('\n') {
|
||||
format!(
|
||||
r#"[[{}]]{}::
|
||||
+
|
||||
--
|
||||
Default:
|
||||
----
|
||||
{}
|
||||
----
|
||||
{}
|
||||
--
|
||||
"#,
|
||||
name, name, default, doc
|
||||
)
|
||||
} else {
|
||||
format!("[[{}]]{} (default: `{}`)::\n+\n--\n{}--\n", name, name, default, doc)
|
||||
}
|
||||
})
|
||||
.collect::<String>()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue