mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Change the body and name of the test function completion
This commit is contained in:
parent
6b1f30ade9
commit
b47a88be9c
@ -432,7 +432,7 @@ mod tests {
|
|||||||
// check_snippet_completion(r"
|
// 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"
|
check_snippet_completion(r"
|
||||||
#[cfg(test)]
|
#[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") }]"##,
|
CompletionItem { label: "pub(crate)", lookup: None, snippet: Some("pub(crate) $0") }]"##,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -173,9 +173,12 @@ fn complete_path(
|
|||||||
|
|
||||||
fn complete_mod_item_snippets(acc: &mut Vec<CompletionItem>) {
|
fn complete_mod_item_snippets(acc: &mut Vec<CompletionItem>) {
|
||||||
acc.push(CompletionItem {
|
acc.push(CompletionItem {
|
||||||
label: "tfn".to_string(),
|
label: "Test function".to_string(),
|
||||||
lookup: None,
|
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 {
|
acc.push(CompletionItem {
|
||||||
label: "pub(crate)".to_string(),
|
label: "pub(crate)".to_string(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user