From 6742f38e49d001359a7a9911becc0fcae4c67910 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sat, 16 Jan 2021 19:33:36 +0200 Subject: Share import_assets and related entities --- crates/ide_db/src/imports_locator.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'crates/ide_db/src/imports_locator.rs') diff --git a/crates/ide_db/src/imports_locator.rs b/crates/ide_db/src/imports_locator.rs index e9f23adf8..d111fba92 100644 --- a/crates/ide_db/src/imports_locator.rs +++ b/crates/ide_db/src/imports_locator.rs @@ -12,6 +12,8 @@ use crate::{ use either::Either; use rustc_hash::FxHashSet; +const QUERY_SEARCH_LIMIT: usize = 40; + pub fn find_exact_imports<'a>( sema: &Semantics<'a, RootDatabase>, krate: Crate, @@ -24,11 +26,11 @@ pub fn find_exact_imports<'a>( { let mut local_query = symbol_index::Query::new(name_to_import.clone()); local_query.exact(); - local_query.limit(40); + local_query.limit(QUERY_SEARCH_LIMIT); local_query }, import_map::Query::new(name_to_import) - .limit(40) + .limit(QUERY_SEARCH_LIMIT) .name_only() .search_mode(import_map::SearchMode::Equals) .case_sensitive(), -- cgit v1.2.3