aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db/src
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2020-12-28 12:54:31 +0000
committerKirill Bulatov <[email protected]>2020-12-28 13:09:39 +0000
commite4c3f753d23752a9fbb01bdf1cd92a8cb1f6681e (patch)
tree3533241d0cc71451350c42d5d48404be7b83e575 /crates/ide_db/src
parentc4995cfbd5b265c02d3038d72b8a022cde5f7040 (diff)
Add docs and optimisations
Diffstat (limited to 'crates/ide_db/src')
-rw-r--r--crates/ide_db/src/imports_locator.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ide_db/src/imports_locator.rs b/crates/ide_db/src/imports_locator.rs
index 986cb5b83..b6355af4b 100644
--- a/crates/ide_db/src/imports_locator.rs
+++ b/crates/ide_db/src/imports_locator.rs
@@ -39,18 +39,18 @@ pub fn find_similar_imports<'a>(
39 sema: &Semantics<'a, RootDatabase>, 39 sema: &Semantics<'a, RootDatabase>,
40 krate: Crate, 40 krate: Crate,
41 limit: Option<usize>, 41 limit: Option<usize>,
42 name_to_import: &str, 42 fuzzy_search_string: &str,
43 name_only: bool, 43 name_only: bool,
44) -> impl Iterator<Item = Either<ModuleDef, MacroDef>> { 44) -> impl Iterator<Item = Either<ModuleDef, MacroDef>> {
45 let _p = profile::span("find_similar_imports"); 45 let _p = profile::span("find_similar_imports");
46 46
47 let mut external_query = 47 let mut external_query =
48 import_map::Query::new(name_to_import).search_mode(import_map::SearchMode::Fuzzy); 48 import_map::Query::new(fuzzy_search_string).search_mode(import_map::SearchMode::Fuzzy);
49 if name_only { 49 if name_only {
50 external_query = external_query.name_only(); 50 external_query = external_query.name_only();
51 } 51 }
52 52
53 let mut local_query = symbol_index::Query::new(name_to_import.to_string()); 53 let mut local_query = symbol_index::Query::new(fuzzy_search_string.to_string());
54 54
55 if let Some(limit) = limit { 55 if let Some(limit) = limit {
56 local_query.limit(limit); 56 local_query.limit(limit);