Consider import prefix config settings during flyimports

This commit is contained in:
Kirill Bulatov 2021-02-20 13:53:50 +02:00
parent 23f0d4baa1
commit 4fe5786c0c
3 changed files with 94 additions and 4 deletions

View file

@ -151,7 +151,7 @@ pub fn resolve_completion_edits(
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)
current_module.find_use_path_prefixed(db, item, config.insert_use.prefix_kind)
})
.find(|mod_path| mod_path.to_string() == full_import_path)?;