ide_assists::utils

Function add_trait_assoc_items_to_impl

source
pub fn add_trait_assoc_items_to_impl(
    sema: &Semantics<'_, RootDatabase>,
    original_items: &[InFile<AssocItem>],
    trait_: Trait,
    impl_: &Impl,
    target_scope: &SemanticsScope<'_>,
) -> AssocItem
Expand description

Given original_items retrieved from the trait definition (usually by filter_assoc_items()), clones each item for update and applies path transformation to it, then inserts into impl_. Returns the modified impl_ and the first associated item that got inserted.