diff options
Diffstat (limited to 'crates/ra_ide/src/completion/complete_scope.rs')
-rw-r--r-- | crates/ra_ide/src/completion/complete_scope.rs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/crates/ra_ide/src/completion/complete_scope.rs b/crates/ra_ide/src/completion/complete_scope.rs index 1cb2ed070..2ca552733 100644 --- a/crates/ra_ide/src/completion/complete_scope.rs +++ b/crates/ra_ide/src/completion/complete_scope.rs | |||
@@ -11,7 +11,6 @@ pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) { | |||
11 | ctx.scope().process_all_names(&mut |name, res| match (ctx.is_pat_binding_and_path, &res) { | 11 | ctx.scope().process_all_names(&mut |name, res| match (ctx.is_pat_binding_and_path, &res) { |
12 | (true, ScopeDef::ModuleDef(ModuleDef::Function(..))) => (), | 12 | (true, ScopeDef::ModuleDef(ModuleDef::Function(..))) => (), |
13 | (true, ScopeDef::ModuleDef(ModuleDef::Static(..))) => (), | 13 | (true, ScopeDef::ModuleDef(ModuleDef::Static(..))) => (), |
14 | (true, ScopeDef::ModuleDef(ModuleDef::Const(..))) => (), | ||
15 | (true, ScopeDef::Local(..)) => (), | 14 | (true, ScopeDef::Local(..)) => (), |
16 | _ => acc.add_resolution(ctx, name.to_string(), &res), | 15 | _ => acc.add_resolution(ctx, name.to_string(), &res), |
17 | }); | 16 | }); |
@@ -28,6 +27,27 @@ mod tests { | |||
28 | } | 27 | } |
29 | 28 | ||
30 | #[test] | 29 | #[test] |
30 | fn bind_pat_and_path_ignore_at() { | ||
31 | assert_debug_snapshot!( | ||
32 | do_reference_completion( | ||
33 | r" | ||
34 | enum Enum { | ||
35 | A, | ||
36 | B, | ||
37 | } | ||
38 | fn quux(x: Option<Enum>) { | ||
39 | match x { | ||
40 | None => (), | ||
41 | Some(en<|> @ Enum::A) => (), | ||
42 | } | ||
43 | } | ||
44 | " | ||
45 | ), | ||
46 | @r###"[]"### | ||
47 | ); | ||
48 | } | ||
49 | |||
50 | #[test] | ||
31 | fn bind_pat_and_path_ignore_ref() { | 51 | fn bind_pat_and_path_ignore_ref() { |
32 | assert_debug_snapshot!( | 52 | assert_debug_snapshot!( |
33 | do_reference_completion( | 53 | do_reference_completion( |