Migrate PathTransform to SyntaxEditor

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
This commit is contained in:
Hayashi Mikihiro 2025-07-26 13:26:39 +09:00
parent 4866c4c2eb
commit 46e86c6aa2
8 changed files with 168 additions and 86 deletions

View file

@ -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,
};