From 67e71619b95dc674c93bd11fb21b311bfc2fb95a Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 5 Oct 2020 17:12:37 +0200 Subject: Make find_path_prefixed configurable --- crates/hir/src/code_model.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/hir') diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index 5721a66c4..5f35d9d3c 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs @@ -4,6 +4,7 @@ use std::{iter, sync::Arc}; use arrayvec::ArrayVec; use base_db::{CrateId, Edition, FileId}; use either::Either; +use hir_def::find_path::PrefixKind; use hir_def::{ adt::ReprKind, adt::StructKind, @@ -391,7 +392,7 @@ impl Module { db: &dyn DefDatabase, item: impl Into, ) -> Option { - hir_def::find_path::find_path_prefixed(db, item.into(), self.into()) + hir_def::find_path::find_path_prefixed(db, item.into(), self.into(), PrefixKind::Plain) } } -- cgit v1.2.3 From 86993310143c1347db6308a66c1f31a7a5644f56 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 5 Oct 2020 17:41:49 +0200 Subject: Make ImportPrefix a configuration option --- crates/hir/src/code_model.rs | 3 ++- crates/hir/src/lib.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/hir') diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index 5f35d9d3c..a445a97b3 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs @@ -391,8 +391,9 @@ impl Module { self, db: &dyn DefDatabase, item: impl Into, + prefix_kind: PrefixKind, ) -> Option { - hir_def::find_path::find_path_prefixed(db, item.into(), self.into(), PrefixKind::Plain) + hir_def::find_path::find_path_prefixed(db, item.into(), self.into(), prefix_kind) } } diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index b9d9c7e25..87084fa13 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -48,6 +48,7 @@ pub use hir_def::{ body::scope::ExprScopes, builtin_type::BuiltinType, docs::Documentation, + find_path::PrefixKind, item_scope::ItemInNs, nameres::ModuleSource, path::ModPath, -- cgit v1.2.3