mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Substitute generic types in inline_call
This commit is contained in:
parent
f2246fecef
commit
7e6eb67f0d
4 changed files with 116 additions and 40 deletions
|
@ -186,13 +186,14 @@ fn get_transformed_assoc_item(
|
|||
let trait_ = impl_def.trait_(ctx.db)?;
|
||||
let source_scope = &ctx.sema.scope_for_def(trait_);
|
||||
let target_scope = &ctx.sema.scope(impl_def.source(ctx.db)?.syntax().value);
|
||||
let transform = PathTransform {
|
||||
subst: (trait_, impl_def.source(ctx.db)?.value),
|
||||
source_scope,
|
||||
let transform = PathTransform::trait_impl(
|
||||
target_scope,
|
||||
};
|
||||
source_scope,
|
||||
trait_,
|
||||
impl_def.source(ctx.db)?.value,
|
||||
);
|
||||
|
||||
transform.apply(assoc_item.clone());
|
||||
transform.apply(assoc_item.syntax());
|
||||
Some(match assoc_item {
|
||||
ast::AssocItem::Fn(func) => ast::AssocItem::Fn(edit::remove_attrs_and_docs(&func)),
|
||||
_ => assoc_item,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue