From e475bcdcc671161cf97d86d116a834c540f75f7c Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 6 Jun 2021 20:02:26 +0200 Subject: Simplify CompletionContext by introducing a path CallKind enum --- crates/ide_completion/src/completions/dot.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ide_completion/src/completions/dot.rs') diff --git a/crates/ide_completion/src/completions/dot.rs b/crates/ide_completion/src/completions/dot.rs index e0a7021fd..22844c2ae 100644 --- a/crates/ide_completion/src/completions/dot.rs +++ b/crates/ide_completion/src/completions/dot.rs @@ -4,7 +4,7 @@ use either::Either; use hir::{HasVisibility, ScopeDef}; use rustc_hash::FxHashSet; -use crate::{context::CompletionContext, Completions}; +use crate::{context::CompletionContext, patterns::ImmediateLocation, Completions}; /// Complete dot accesses, i.e. fields or methods. pub(crate) fn complete_dot(acc: &mut Completions, ctx: &CompletionContext) { @@ -18,7 +18,7 @@ pub(crate) fn complete_dot(acc: &mut Completions, ctx: &CompletionContext) { _ => return, }; - if ctx.is_call { + if matches!(ctx.completion_location, Some(ImmediateLocation::MethodCall { .. })) { cov_mark::hit!(test_no_struct_field_completion_for_method_call); } else { complete_fields(ctx, &receiver_ty, |field, ty| match field { -- cgit v1.2.3