aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-10-23 14:41:55 +0100
committerAleksey Kladov <[email protected]>2018-10-23 14:42:07 +0100
commit1d574ed6543936af7d1d16c4b4ea9b4bd858aa41 (patch)
tree651bb3b033eec863f90e9004846c3f6f1af8b3e3 /crates
parented736b1ac1d75eaea650d5d953950f0aed947865 (diff)
complete pub(crate)
Diffstat (limited to 'crates')
-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}