diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_analysis/src/completion/mod.rs | 4 | ||||
-rw-r--r-- | crates/ra_analysis/src/completion/reference_completion.rs | 12 |
2 files changed, 11 insertions, 5 deletions
diff --git a/crates/ra_analysis/src/completion/mod.rs b/crates/ra_analysis/src/completion/mod.rs index e5ba92acd..124da486a 100644 --- a/crates/ra_analysis/src/completion/mod.rs +++ b/crates/ra_analysis/src/completion/mod.rs | |||
@@ -427,7 +427,7 @@ mod tests { | |||
427 | // check_snippet_completion(r" | 427 | // check_snippet_completion(r" |
428 | // <|> | 428 | // <|> |
429 | // ", | 429 | // ", |
430 | // r##"[CompletionItem { label: "tfn", lookup: None, snippet: Some("#[test]\nfn $1() {\n $0\n}") }]"##, | 430 | // r##"[CompletionItem { label: "Test function", lookup: None, snippet: Some("#[test]\nfn test_${1:feature}() {\n$0\n}"##, |
431 | // ); | 431 | // ); |
432 | check_snippet_completion(r" | 432 | check_snippet_completion(r" |
433 | #[cfg(test)] | 433 | #[cfg(test)] |
@@ -435,7 +435,7 @@ mod tests { | |||
435 | <|> | 435 | <|> |
436 | } | 436 | } |
437 | ", | 437 | ", |
438 | r##"[CompletionItem { label: "tfn", lookup: None, snippet: Some("#[test]\nfn $1() {\n $0\n}") }, | 438 | r##"[CompletionItem { label: "Test function", lookup: Some("tfn"), snippet: Some("#[test]\nfn ${1:feature}() {\n$0\n}") }, |
439 | CompletionItem { label: "pub(crate)", lookup: None, snippet: Some("pub(crate) $0") }]"##, | 439 | CompletionItem { label: "pub(crate)", lookup: None, snippet: Some("pub(crate) $0") }]"##, |
440 | ); | 440 | ); |
441 | } | 441 | } |
diff --git a/crates/ra_analysis/src/completion/reference_completion.rs b/crates/ra_analysis/src/completion/reference_completion.rs index e1a2d5241..8ea7478a8 100644 --- a/crates/ra_analysis/src/completion/reference_completion.rs +++ b/crates/ra_analysis/src/completion/reference_completion.rs | |||
@@ -177,9 +177,15 @@ fn complete_path( | |||
177 | 177 | ||
178 | fn complete_mod_item_snippets(acc: &mut Vec<CompletionItem>) { | 178 | fn complete_mod_item_snippets(acc: &mut Vec<CompletionItem>) { |
179 | acc.push(CompletionItem { | 179 | acc.push(CompletionItem { |
180 | label: "tfn".to_string(), | 180 | label: "Test function".to_string(), |
181 | lookup: None, | 181 | lookup: Some("tfn".to_string()), |
182 | snippet: Some("#[test]\nfn $1() {\n $0\n}".to_string()), | 182 | snippet: Some( |
183 | "#[test]\n\ | ||
184 | fn ${1:feature}() {\n\ | ||
185 | $0\n\ | ||
186 | }" | ||
187 | .to_string(), | ||
188 | ), | ||
183 | }); | 189 | }); |
184 | acc.push(CompletionItem { | 190 | acc.push(CompletionItem { |
185 | label: "pub(crate)".to_string(), | 191 | label: "pub(crate)".to_string(), |