mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 05:13:35 +00:00
Migrate PathTransform to SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
This commit is contained in:
parent
4866c4c2eb
commit
46e86c6aa2
8 changed files with 168 additions and 86 deletions
|
|
@ -114,9 +114,13 @@ pub(crate) fn generate_delegate_methods(acc: &mut Assists, ctx: &AssistContext<'
|
|||
let source_scope = ctx.sema.scope(v.syntax());
|
||||
let target_scope = ctx.sema.scope(strukt.syntax());
|
||||
if let (Some(s), Some(t)) = (source_scope, target_scope) {
|
||||
PathTransform::generic_transformation(&t, &s).apply(v.syntax());
|
||||
ast::Fn::cast(
|
||||
PathTransform::generic_transformation(&t, &s).apply(v.syntax()),
|
||||
)
|
||||
.unwrap_or(v)
|
||||
} else {
|
||||
v
|
||||
}
|
||||
v
|
||||
}
|
||||
None => return,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue