diff --git a/crates/ra_editor/src/completion.rs b/crates/ra_editor/src/completion.rs index 86ef46ebd94..8502b337d1a 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) { lookup: None, snippet: Some("#[test]\nfn $1() {\n $0\n}".to_string()), }); + acc.push(CompletionItem { + label: "pub(crate)".to_string(), + lookup: None, + snippet: Some("pub(crate) $0".to_string()), + }) } fn complete_fn(name_ref: ast::NameRef, scopes: &FnScopes, acc: &mut Vec) { @@ -573,7 +578,7 @@ pub fn syntax(&self, file<|>) } #[test] - fn test_tfn_snippet() { + fn test_item_snippets() { // check_snippet_completion(r" // <|> // ", @@ -585,7 +590,8 @@ mod tests { <|> } ", - r##"[CompletionItem { label: "tfn", lookup: None, snippet: Some("#[test]\nfn $1() {\n $0\n}") }]"##, + r##"[CompletionItem { label: "tfn", lookup: None, snippet: Some("#[test]\nfn $1() {\n $0\n}") }, + CompletionItem { label: "pub(crate)", lookup: None, snippet: Some("pub(crate) $0") }]"##, ); } }