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

@ -85,7 +85,7 @@ pub(crate) fn replace_derive_with_manual_impl(
})
.flat_map(|trait_| {
current_module
.find_use_path(ctx.sema.db, hir::ModuleDef::Trait(trait_))
.find_use_path(ctx.sema.db, hir::ModuleDef::Trait(trait_), ctx.config.prefer_core)
.as_ref()
.map(mod_path_to_ast)
.zip(Some(trait_))