Add config to unconditionally prefer core imports over std

Fixes https://github.com/rust-lang/rust-analyzer/issues/12979
This commit is contained in:
Lukas Wirth 2022-09-09 20:04:56 +02:00
parent 6909556435
commit 7d19971666
33 changed files with 156 additions and 43 deletions

View file

@ -234,7 +234,12 @@ pub fn resolve_completion_edits(
);
let import = items_with_name
.filter_map(|candidate| {
current_module.find_use_path_prefixed(db, candidate, config.insert_use.prefix_kind)
current_module.find_use_path_prefixed(
db,
candidate,
config.insert_use.prefix_kind,
config.prefer_core,
)
})
.find(|mod_path| mod_path.to_string() == full_import_path);
if let Some(import_path) = import {