diff --git a/crates/ra_ide/src/completion/complete_snippet.rs b/crates/ra_ide/src/completion/complete_snippet.rs index a3f5d1b6a0..0568d9ccf3 100644 --- a/crates/ra_ide/src/completion/complete_snippet.rs +++ b/crates/ra_ide/src/completion/complete_snippet.rs @@ -33,6 +33,24 @@ pub(super) fn complete_item_snippet(acc: &mut Completions, ctx: &CompletionConte None => return, }; + snippet( + ctx, + cap, + "Test module", + "\ +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn ${1:test_name}() { + $0 + } +}", + ) + .lookup_by("tmod") + .add_to(acc); + snippet( ctx, cap, @@ -117,6 +135,14 @@ mod tests { kind: Snippet, lookup: "tfn", }, + CompletionItem { + label: "Test module", + source_range: 78..78, + delete: 78..78, + insert: "#[cfg(test)]\nmod tests {\n use super::*;\n\n #[test]\n fn ${1:test_name}() {\n $0\n }\n}", + kind: Snippet, + lookup: "tmod", + }, CompletionItem { label: "macro_rules", source_range: 78..78,