aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/completion
diff options
context:
space:
mode:
authorDaniel McNab <[email protected]>2018-11-28 17:04:03 +0000
committerDaniel McNab <[email protected]>2018-11-28 17:04:03 +0000
commitb47a88be9c2d486cc97c0e893f7b47d5d071f93b (patch)
tree20ba781147f63c370206edeb9a0c6c355ed0f3ce /crates/ra_analysis/src/completion
parent6b1f30ade93b3bd73625cc354652738254175dba (diff)
Change the body and name of the test function completion
Diffstat (limited to 'crates/ra_analysis/src/completion')
-rw-r--r--crates/ra_analysis/src/completion/mod.rs4
-rw-r--r--crates/ra_analysis/src/completion/reference_completion.rs7
2 files changed, 7 insertions, 4 deletions
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 {
432 // check_snippet_completion(r" 432 // check_snippet_completion(r"
433 // <|> 433 // <|>
434 // ", 434 // ",
435 // r##"[CompletionItem { label: "tfn", lookup: None, snippet: Some("#[test]\nfn $1() {\n $0\n}") }]"##, 435 // r##"[CompletionItem { label: "Test function", lookup: None, snippet: Some("#[test]\nfn test_${1:feature}() {\n$0\n}"##,
436 // ); 436 // );
437 check_snippet_completion(r" 437 check_snippet_completion(r"
438 #[cfg(test)] 438 #[cfg(test)]
@@ -440,7 +440,7 @@ mod tests {
440 <|> 440 <|>
441 } 441 }
442 ", 442 ",
443 r##"[CompletionItem { label: "tfn", lookup: None, snippet: Some("#[test]\nfn $1() {\n $0\n}") }, 443 r##"[CompletionItem { label: "Test function", lookup: None, snippet: Some("#[test]\nfn test_${1:feature}() {\n$0\n}") },
444 CompletionItem { label: "pub(crate)", lookup: None, snippet: Some("pub(crate) $0") }]"##, 444 CompletionItem { label: "pub(crate)", lookup: None, snippet: Some("pub(crate) $0") }]"##,
445 ); 445 );
446 } 446 }
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(
173 173
174fn complete_mod_item_snippets(acc: &mut Vec<CompletionItem>) { 174fn complete_mod_item_snippets(acc: &mut Vec<CompletionItem>) {
175 acc.push(CompletionItem { 175 acc.push(CompletionItem {
176 label: "tfn".to_string(), 176 label: "Test function".to_string(),
177 lookup: None, 177 lookup: None,
178 snippet: Some("#[test]\nfn $1() {\n $0\n}".to_string()), 178 snippet: Some("#[test]\n\
179 fn test_${1:feature}() {\n\
180 $0\n\
181 }".to_string()),
179 }); 182 });
180 acc.push(CompletionItem { 183 acc.push(CompletionItem {
181 label: "pub(crate)".to_string(), 184 label: "pub(crate)".to_string(),