aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_editor/src/completion.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/ra_editor/src/completion.rs b/crates/ra_editor/src/completion.rs
index 86ef46ebd..8502b337d 100644
--- a/crates/ra_editor/src/completion.rs
+++ b/crates/ra_editor/src/completion.rs
@@ -251,6 +251,11 @@ fn complete_mod_item_snippets(acc: &mut Vec<CompletionItem>) {
251 lookup: None, 251 lookup: None,
252 snippet: Some("#[test]\nfn $1() {\n $0\n}".to_string()), 252 snippet: Some("#[test]\nfn $1() {\n $0\n}".to_string()),
253 }); 253 });
254 acc.push(CompletionItem {
255 label: "pub(crate)".to_string(),
256 lookup: None,
257 snippet: Some("pub(crate) $0".to_string()),
258 })
254} 259}
255 260
256fn complete_fn(name_ref: ast::NameRef, scopes: &FnScopes, acc: &mut Vec<CompletionItem>) { 261fn complete_fn(name_ref: ast::NameRef, scopes: &FnScopes, acc: &mut Vec<CompletionItem>) {
@@ -573,7 +578,7 @@ mod tests {
573 } 578 }
574 579
575 #[test] 580 #[test]
576 fn test_tfn_snippet() { 581 fn test_item_snippets() {
577 // check_snippet_completion(r" 582 // check_snippet_completion(r"
578 // <|> 583 // <|>
579 // ", 584 // ",
@@ -585,7 +590,8 @@ mod tests {
585 <|> 590 <|>
586 } 591 }
587 ", 592 ",
588 r##"[CompletionItem { label: "tfn", lookup: None, snippet: Some("#[test]\nfn $1() {\n $0\n}") }]"##, 593 r##"[CompletionItem { label: "tfn", lookup: None, snippet: Some("#[test]\nfn $1() {\n $0\n}") },
594 CompletionItem { label: "pub(crate)", lookup: None, snippet: Some("pub(crate) $0") }]"##,
589 ); 595 );
590 } 596 }
591} 597}