mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Rename target_ty to self_ty
This commit is contained in:
parent
bb6e1bf811
commit
c2a63b97a8
16 changed files with 27 additions and 27 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue