pub fn resolve_completion_edits(
    db: &RootDatabase,
    config: &CompletionConfig,
    position: FilePosition,
    full_import_path: &str,
    imported_name: String,
    import_for_trait_assoc_item: bool,
) -> Option<Vec<TextEdit>> {
    let ctx = CompletionContext::new(db, position, config)?;
    let position_for_import = position_for_import(&ctx, None)?;
    let import_scope = ImportScope::find_insert_use_container(position_for_import, &ctx.sema)?;

    let current_module = ctx.sema.scope(position_for_import).module()?;
    let current_crate = current_module.krate();

    let import_path = imports_locator::find_exact_imports(&ctx.sema, current_crate, imported_name)
        .filter_map(|candidate| {
            let item: hir::ItemInNs = candidate.either(Into::into, Into::into);
            current_module.find_use_path(db, item)
        })
        .find(|mod_path| mod_path.to_string() == full_import_path)?;

    ImportEdit { import_path, import_scope, import_for_trait_assoc_item }
        .to_text_edit(config.insert_use.merge)
        .map(|edit| vec![edit])
}
/// Resolves additional completion data at the position given.
Resolves additional completion data at the position given.
Resolves additional completion data at the position given .
pub fn resolve_completion_edits(
    db: &RootDatabase,
    config: &CompletionConfig,
    position: FilePosition,
    full_import_path: &str,
    imported_name: String,
    import_for_trait_assoc_item: bool,
) -> Option<Vec<TextEdit>> {
    let ctx = CompletionContext::new(db, position, config)?;
    let position_for_import = position_for_import(&ctx, None)?;
    let import_scope = ImportScope::find_insert_use_container(position_for_import, &ctx.sema)?;
    let current_module = ctx.sema.scope(position_for_import).module()?;
    let current_crate = current_module.krate();
    let import_path = imports_locator::find_exact_imports(&ctx.sema, current_crate, imported_name)
        .filter_map(|candidate| {
            let item: hir::ItemInNs = candidate.either(Into::into, Into::into);
            current_module.find_use_path(db, item)
        })
        .find(|mod_path| mod_path.to_string() == full_import_path)?;
    ImportEdit { import_path, import_scope, import_for_trait_assoc_item }
        .to_text_edit(config.insert_use.merge)
        .map(|edit| vec![edit])
}
pub fn resolve_completion_edits ( db : & RootDatabase , config : & CompletionConfig , position : FilePosition , full_import_path : & str , imported_name : String , import_for_trait_assoc_item : bool , ) -> Option < Vec < TextEdit > > { let ctx = CompletionContext :: new ( db , position , config ) ? ; let position_for_import = position_for_import ( & ctx , None ) ? ; let import_scope = ImportScope :: find_insert_use_container ( position_for_import , & ctx . sema ) ? ; let current_module = ctx . sema . scope ( position_for_import ) . module ( ) ? ; let current_crate = current_module . krate ( ) ; let import_path = imports_locator :: find_exact_imports ( & ctx . sema , current_crate , imported_name ) . filter_map ( | candidate | { let item : hir :: ItemInNs = candidate . either ( Into :: into , Into :: into ) ; current_module . find_use_path ( db , item ) } ) . find ( | mod_path | mod_path . to_string ( ) == full_import_path ) ? ; ImportEdit { import_path , import_scope , import_for_trait_assoc_item } . to_text_edit ( config . insert_use . merge ) . map ( | edit | vec ! [ edit ] ) }
Resolves additional completion data at the position given.
Resolves additional completion data at the position given .
db
&RootDatabase
config
&CompletionConfig
position
FilePosition
full_import_path
&str
imported_name
String
import_for_trait_assoc_item
bool