Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/completions/expr.rs')
-rw-r--r--crates/ide-completion/src/completions/expr.rs18
1 files changed, 11 insertions, 7 deletions
diff --git a/crates/ide-completion/src/completions/expr.rs b/crates/ide-completion/src/completions/expr.rs
index 1e31d65fdd..ddb1aeb371 100644
--- a/crates/ide-completion/src/completions/expr.rs
+++ b/crates/ide-completion/src/completions/expr.rs
@@ -1,6 +1,6 @@
//! Completion of names from the current scope in expression position.
-use hir::ScopeDef;
+use hir::{ImportPathConfig, ScopeDef};
use syntax::ast;
use crate::{
@@ -171,11 +171,13 @@ pub(crate) fn complete_expr_path(
hir::Adt::Struct(strukt) => {
let path = ctx
.module
- .find_use_path(
+ .find_path(
ctx.db,
hir::ModuleDef::from(strukt),
- ctx.config.prefer_no_std,
- ctx.config.prefer_prelude,
+ ImportPathConfig {
+ prefer_no_std: ctx.config.prefer_no_std,
+ prefer_prelude: ctx.config.prefer_prelude,
+ },
)
.filter(|it| it.len() > 1);
@@ -194,11 +196,13 @@ pub(crate) fn complete_expr_path(
hir::Adt::Union(un) => {
let path = ctx
.module
- .find_use_path(
+ .find_path(
ctx.db,
hir::ModuleDef::from(un),
- ctx.config.prefer_no_std,
- ctx.config.prefer_prelude,
+ ImportPathConfig {
+ prefer_no_std: ctx.config.prefer_no_std,
+ prefer_prelude: ctx.config.prefer_prelude,
+ },
)
.filter(|it| it.len() > 1);