From b47a88be9c2d486cc97c0e893f7b47d5d071f93b Mon Sep 17 00:00:00 2001 From: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> Date: Wed, 28 Nov 2018 17:04:03 +0000 Subject: Change the body and name of the test function completion --- crates/ra_analysis/src/completion/mod.rs | 4 ++-- crates/ra_analysis/src/completion/reference_completion.rs | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'crates/ra_analysis/src/completion') diff --git a/crates/ra_analysis/src/completion/mod.rs b/crates/ra_analysis/src/completion/mod.rs index c7717ab61..839fae641 100644 --- a/crates/ra_analysis/src/completion/mod.rs +++ b/crates/ra_analysis/src/completion/mod.rs @@ -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") }]"##, ); } diff --git a/crates/ra_analysis/src/completion/reference_completion.rs b/crates/ra_analysis/src/completion/reference_completion.rs index d301a3c02..e8eb77440 100644 --- a/crates/ra_analysis/src/completion/reference_completion.rs +++ b/crates/ra_analysis/src/completion/reference_completion.rs @@ -173,9 +173,12 @@ fn complete_path( fn complete_mod_item_snippets(acc: &mut Vec) { 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(), -- cgit v1.2.3