Rename target_ty to self_ty

This commit is contained in:
Lukas Wirth 2021-03-29 17:46:33 +02:00
parent bb6e1bf811
commit c2a63b97a8
16 changed files with 27 additions and 27 deletions

View file

@ -220,7 +220,7 @@ fn complete_enum_variants(
};
if let Some(impl_) = ctx.impl_def.as_ref().and_then(|impl_| ctx.sema.to_def(impl_)) {
if impl_.target_ty(ctx.db) == *ty {
if impl_.self_ty(ctx.db) == *ty {
for &variant in &variants {
let self_path = hir::ModPath::from_segments(
hir::PathKind::Plain,

View file

@ -40,7 +40,7 @@ pub(crate) fn complete_pattern(acc: &mut Completions, ctx: &CompletionContext) {
_ => false,
},
hir::ScopeDef::MacroDef(_) => true,
hir::ScopeDef::ImplSelfType(impl_) => match impl_.target_ty(ctx.db).as_adt() {
hir::ScopeDef::ImplSelfType(impl_) => match impl_.self_ty(ctx.db).as_adt() {
Some(hir::Adt::Struct(strukt)) => {
acc.add_struct_pat(ctx, strukt, Some(name.clone()));
true

View file

@ -117,7 +117,7 @@ pub(crate) fn complete_qualified_path(acc: &mut Completions, ctx: &CompletionCon
if let Some(krate) = ctx.krate {
let ty = match resolution {
PathResolution::TypeParam(param) => param.ty(ctx.db),
PathResolution::SelfType(impl_def) => impl_def.target_ty(ctx.db),
PathResolution::SelfType(impl_def) => impl_def.self_ty(ctx.db),
_ => return,
};