Fix documentation of snippet
This commit is contained in:
parent
0f8c96c926
commit
01b3ce3006
@ -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>()
|
||||
}
|
||||
|
@ -146,7 +146,12 @@ Only applies when `#rust-analyzer.completion.addCallParenthesis#` is set.
|
||||
--
|
||||
Whether to add parenthesis when completing functions.
|
||||
--
|
||||
[[rust-analyzer.completion.snippets]]rust-analyzer.completion.snippets (default: `{
|
||||
[[rust-analyzer.completion.snippets]]rust-analyzer.completion.snippets::
|
||||
+
|
||||
--
|
||||
Default:
|
||||
----
|
||||
{
|
||||
"Arc::new": {
|
||||
"postfix": "arc",
|
||||
"body": "Arc::new(${receiver})",
|
||||
@ -186,10 +191,10 @@ Whether to add parenthesis when completing functions.
|
||||
"description": "Wrap the expression in an `Option::Some`",
|
||||
"scope": "expr"
|
||||
}
|
||||
}`)::
|
||||
+
|
||||
--
|
||||
}
|
||||
----
|
||||
Custom completion snippets.
|
||||
|
||||
--
|
||||
[[rust-analyzer.completion.postfix.enable]]rust-analyzer.completion.postfix.enable (default: `true`)::
|
||||
+
|
||||
|
Loading…
Reference in New Issue
Block a user