Change the body and name of the test function completion

This commit is contained in:
Daniel McNab 2018-11-28 17:04:03 +00:00
parent 6b1f30ade9
commit b47a88be9c
2 changed files with 7 additions and 4 deletions

View file

@ -432,7 +432,7 @@ mod tests {
// check_snippet_completion(r"
// <|>
// ",
// r##"[CompletionItem { label: "tfn", lookup: None, snippet: Some("#[test]\nfn $1() {\n $0\n}") }]"##,
// r##"[CompletionItem { label: "Test function", lookup: None, snippet: Some("#[test]\nfn test_${1:feature}() {\n$0\n}"##,
// );
check_snippet_completion(r"
#[cfg(test)]
@ -440,7 +440,7 @@ mod tests {
<|>
}
",
r##"[CompletionItem { label: "tfn", lookup: None, snippet: Some("#[test]\nfn $1() {\n $0\n}") },
r##"[CompletionItem { label: "Test function", lookup: None, snippet: Some("#[test]\nfn test_${1:feature}() {\n$0\n}") },
CompletionItem { label: "pub(crate)", lookup: None, snippet: Some("pub(crate) $0") }]"##,
);
}

View file

@ -173,9 +173,12 @@ fn complete_path(
fn complete_mod_item_snippets(acc: &mut Vec<CompletionItem>) {
acc.push(CompletionItem {
label: "tfn".to_string(),
label: "Test function".to_string(),
lookup: None,
snippet: Some("#[test]\nfn $1() {\n $0\n}".to_string()),
snippet: Some("#[test]\n\
fn test_${1:feature}() {\n\
$0\n\
}".to_string()),
});
acc.push(CompletionItem {
label: "pub(crate)".to_string(),