diff options
Diffstat (limited to 'crates/ide_completion/src/completions/dot.rs')
-rw-r--r-- | crates/ide_completion/src/completions/dot.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ide_completion/src/completions/dot.rs b/crates/ide_completion/src/completions/dot.rs index 302c9ccbd..e0a7021fd 100644 --- a/crates/ide_completion/src/completions/dot.rs +++ b/crates/ide_completion/src/completions/dot.rs | |||
@@ -8,7 +8,7 @@ use crate::{context::CompletionContext, Completions}; | |||
8 | 8 | ||
9 | /// Complete dot accesses, i.e. fields or methods. | 9 | /// Complete dot accesses, i.e. fields or methods. |
10 | pub(crate) fn complete_dot(acc: &mut Completions, ctx: &CompletionContext) { | 10 | pub(crate) fn complete_dot(acc: &mut Completions, ctx: &CompletionContext) { |
11 | let dot_receiver = match &ctx.dot_receiver { | 11 | let dot_receiver = match ctx.dot_receiver() { |
12 | Some(expr) => expr, | 12 | Some(expr) => expr, |
13 | _ => return complete_undotted_self(acc, ctx), | 13 | _ => return complete_undotted_self(acc, ctx), |
14 | }; | 14 | }; |
@@ -30,7 +30,10 @@ pub(crate) fn complete_dot(acc: &mut Completions, ctx: &CompletionContext) { | |||
30 | } | 30 | } |
31 | 31 | ||
32 | fn complete_undotted_self(acc: &mut Completions, ctx: &CompletionContext) { | 32 | fn complete_undotted_self(acc: &mut Completions, ctx: &CompletionContext) { |
33 | if !ctx.is_trivial_path || !ctx.config.enable_self_on_the_fly { | 33 | if !ctx.config.enable_self_on_the_fly { |
34 | return; | ||
35 | } | ||
36 | if !ctx.is_trivial_path || ctx.is_path_disallowed() { | ||
34 | return; | 37 | return; |
35 | } | 38 | } |
36 | ctx.scope.process_all_names(&mut |name, def| { | 39 | ctx.scope.process_all_names(&mut |name, def| { |