From 0e48cd0c3c712cea0267476de974012b2b05b508 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Mon, 28 Dec 2020 11:41:08 +0200 Subject: Draft the module exclusion in modules --- crates/ide_db/src/imports_locator.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'crates/ide_db') diff --git a/crates/ide_db/src/imports_locator.rs b/crates/ide_db/src/imports_locator.rs index b2980a5d6..0de949b9a 100644 --- a/crates/ide_db/src/imports_locator.rs +++ b/crates/ide_db/src/imports_locator.rs @@ -27,7 +27,12 @@ pub fn find_exact_imports<'a>( local_query.limit(40); local_query }, - import_map::Query::new(name_to_import).anchor_end().case_sensitive().limit(40), + import_map::Query::new(name_to_import) + .limit(40) + .name_only() + .name_end() + .strict_include() + .case_sensitive(), ) } @@ -36,11 +41,12 @@ pub fn find_similar_imports<'a>( krate: Crate, limit: Option, name_to_import: &str, + // TODO kb change it to search across the whole path or not? ignore_modules: bool, ) -> impl Iterator> { let _p = profile::span("find_similar_imports"); - let mut external_query = import_map::Query::new(name_to_import); + let mut external_query = import_map::Query::new(name_to_import).name_only(); if ignore_modules { external_query = external_query.exclude_import_kind(import_map::ImportKind::Module); } -- cgit v1.2.3