aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/completions/snippet.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-06-17 14:44:38 +0100
committerGitHub <[email protected]>2021-06-17 14:44:38 +0100
commit3ae0c5911ab50ee209179ee4329b0551abe6fc48 (patch)
tree8c8fb1436a64a6bfd56558f41b734a966aa5725e /crates/ide_completion/src/completions/snippet.rs
parentc82a9141abe6b6cbf5b55710dc8a315a3839081b (diff)
parent2a48b532208de413e4e5d39e81c33a4644ecaa22 (diff)
Merge #9312
9312: internal: Move out item specific completion tests r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/ide_completion/src/completions/snippet.rs')
-rw-r--r--crates/ide_completion/src/completions/snippet.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ide_completion/src/completions/snippet.rs b/crates/ide_completion/src/completions/snippet.rs
index 81ddfa34f..cbc20cc2c 100644
--- a/crates/ide_completion/src/completions/snippet.rs
+++ b/crates/ide_completion/src/completions/snippet.rs
@@ -36,7 +36,11 @@ pub(crate) fn complete_expr_snippet(acc: &mut Completions, ctx: &CompletionConte
36} 36}
37 37
38pub(crate) fn complete_item_snippet(acc: &mut Completions, ctx: &CompletionContext) { 38pub(crate) fn complete_item_snippet(acc: &mut Completions, ctx: &CompletionContext) {
39 if !ctx.expects_item() || ctx.previous_token_is(T![unsafe]) || ctx.path_qual().is_some() { 39 if !ctx.expects_item()
40 || ctx.previous_token_is(T![unsafe])
41 || ctx.path_qual().is_some()
42 || ctx.has_impl_or_trait_prev_sibling()
43 {
40 return; 44 return;
41 } 45 }
42 if ctx.has_visibility_prev_sibling() { 46 if ctx.has_visibility_prev_sibling() {