From 1d574ed6543936af7d1d16c4b4ea9b4bd858aa41 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 23 Oct 2018 16:41:55 +0300 Subject: complete pub(crate) --- crates/ra_editor/src/completion.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'crates/ra_editor/src') 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) { 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 @@ mod tests { } #[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") }]"##, ); } } -- cgit v1.2.3