Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/context.rs')
| -rw-r--r-- | crates/ide-completion/src/context.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/crates/ide-completion/src/context.rs b/crates/ide-completion/src/context.rs index bc2c2fc713..0c7c6ab5af 100644 --- a/crates/ide-completion/src/context.rs +++ b/crates/ide-completion/src/context.rs @@ -98,6 +98,7 @@ pub(super) enum PathKind { is_func_update: Option<ast::RecordExpr>, self_param: Option<hir::SelfParam>, innermost_ret_ty: Option<hir::Type>, + impl_: Option<ast::Impl>, }, Type { location: TypeLocation, @@ -143,12 +144,12 @@ pub(crate) enum TypeAscriptionTarget { } /// The kind of item list a [`PathKind::Item`] belongs to. -#[derive(Copy, Clone, Debug, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq)] pub(super) enum ItemListKind { SourceFile, Module, Impl, - TraitImpl, + TraitImpl(Option<ast::Impl>), Trait, ExternBlock, } @@ -179,6 +180,7 @@ pub(super) struct PatternContext { pub(super) mut_token: Option<SyntaxToken>, /// The record pattern this name or ref is a field of pub(super) record_pat: Option<ast::RecordPat>, + pub(super) impl_: Option<ast::Impl>, } /// The state of the lifetime we are completing. @@ -320,10 +322,6 @@ pub(crate) struct CompletionContext<'a> { /// The expected type of what we are completing. pub(super) expected_type: Option<Type>, - /// The parent impl of the cursor position if it exists. - // FIXME: This probably doesn't belong here - pub(super) impl_def: Option<ast::Impl>, - // FIXME: This shouldn't exist pub(super) previous_token: Option<SyntaxToken>, @@ -497,7 +495,6 @@ impl<'a> CompletionContext<'a> { module, expected_name: None, expected_type: None, - impl_def: None, previous_token: None, // dummy value, will be overwritten ident_ctx: IdentContext::UnexpandedAttrTT { fake_attribute_under_caret: None }, |