mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Add config to unconditionally prefer core imports over std
Fixes https://github.com/rust-lang/rust-analyzer/issues/12979
This commit is contained in:
parent
6909556435
commit
7d19971666
33 changed files with 156 additions and 43 deletions
|
@ -165,7 +165,11 @@ pub(crate) fn complete_expr_path(
|
|||
hir::Adt::Struct(strukt) => {
|
||||
let path = ctx
|
||||
.module
|
||||
.find_use_path(ctx.db, hir::ModuleDef::from(strukt))
|
||||
.find_use_path(
|
||||
ctx.db,
|
||||
hir::ModuleDef::from(strukt),
|
||||
ctx.config.prefer_core,
|
||||
)
|
||||
.filter(|it| it.len() > 1);
|
||||
|
||||
acc.add_struct_literal(ctx, path_ctx, strukt, path, None);
|
||||
|
@ -183,7 +187,7 @@ pub(crate) fn complete_expr_path(
|
|||
hir::Adt::Union(un) => {
|
||||
let path = ctx
|
||||
.module
|
||||
.find_use_path(ctx.db, hir::ModuleDef::from(un))
|
||||
.find_use_path(ctx.db, hir::ModuleDef::from(un), ctx.config.prefer_core)
|
||||
.filter(|it| it.len() > 1);
|
||||
|
||||
acc.add_union_literal(ctx, un, path, None);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue