mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
fix: rewrite code_action generate_delegate_trait
This commit is contained in:
parent
19387d3077
commit
59aa791fe6
8 changed files with 983 additions and 158 deletions
|
@ -82,6 +82,34 @@ impl<'a> PathTransform<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn impl_transformation(
|
||||
target_scope: &'a SemanticsScope<'a>,
|
||||
source_scope: &'a SemanticsScope<'a>,
|
||||
impl_: hir::Impl,
|
||||
generic_arg_list: ast::GenericArgList,
|
||||
) -> PathTransform<'a> {
|
||||
PathTransform {
|
||||
source_scope,
|
||||
target_scope,
|
||||
generic_def: Some(impl_.into()),
|
||||
substs: get_type_args_from_arg_list(generic_arg_list).unwrap_or_default(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn adt_transformation(
|
||||
target_scope: &'a SemanticsScope<'a>,
|
||||
source_scope: &'a SemanticsScope<'a>,
|
||||
adt: hir::Adt,
|
||||
generic_arg_list: ast::GenericArgList,
|
||||
) -> PathTransform<'a> {
|
||||
PathTransform {
|
||||
source_scope,
|
||||
target_scope,
|
||||
generic_def: Some(adt.into()),
|
||||
substs: get_type_args_from_arg_list(generic_arg_list).unwrap_or_default(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn generic_transformation(
|
||||
target_scope: &'a SemanticsScope<'a>,
|
||||
source_scope: &'a SemanticsScope<'a>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue