aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/completion/src/completions/unqualified_path.rs2
-rw-r--r--crates/hir/src/lib.rs2
-rw-r--r--crates/ide_db/src/imports_locator.rs16
3 files changed, 10 insertions, 10 deletions
diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs
index 362d31f25..4f8ec1e67 100644
--- a/crates/completion/src/completions/unqualified_path.rs
+++ b/crates/completion/src/completions/unqualified_path.rs
@@ -72,7 +72,7 @@ fn complete_enum_variants(acc: &mut Completions, ctx: &CompletionContext, ty: &T
72} 72}
73 73
74fn fuzzy_completion(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> { 74fn fuzzy_completion(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> {
75 let _p = profile::span("fuzzy_completion®"); 75 let _p = profile::span("fuzzy_completion");
76 let current_module = ctx.scope.module()?; 76 let current_module = ctx.scope.module()?;
77 let anchor = ctx.name_ref_syntax.as_ref()?; 77 let anchor = ctx.name_ref_syntax.as_ref()?;
78 let import_scope = ImportScope::find_insert_use_container(anchor.syntax(), &ctx.sema)?; 78 let import_scope = ImportScope::find_insert_use_container(anchor.syntax(), &ctx.sema)?;
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 4b7ea3aa9..5fea25ef1 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -49,7 +49,7 @@ pub use hir_def::{
49 builtin_type::BuiltinType, 49 builtin_type::BuiltinType,
50 docs::Documentation, 50 docs::Documentation,
51 find_path::PrefixKind, 51 find_path::PrefixKind,
52 import_map::Query as ExternalImportablesQuery, 52 import_map,
53 item_scope::ItemInNs, 53 item_scope::ItemInNs,
54 nameres::ModuleSource, 54 nameres::ModuleSource,
55 path::{ModPath, PathKind}, 55 path::{ModPath, PathKind},
diff --git a/crates/ide_db/src/imports_locator.rs b/crates/ide_db/src/imports_locator.rs
index 1b21f76ac..9d8ea7368 100644
--- a/crates/ide_db/src/imports_locator.rs
+++ b/crates/ide_db/src/imports_locator.rs
@@ -1,12 +1,12 @@
1//! This module contains an import search funcionality that is provided to the assists module. 1//! This module contains an import search funcionality that is provided to the assists module.
2//! Later, this should be moved away to a separate crate that is accessible from the assists module. 2//! Later, this should be moved away to a separate crate that is accessible from the assists module.
3 3
4use hir::{Crate, ExternalImportablesQuery, MacroDef, ModuleDef, Semantics}; 4use hir::{import_map, Crate, MacroDef, ModuleDef, Semantics};
5use syntax::{ast, AstNode, SyntaxKind::NAME}; 5use syntax::{ast, AstNode, SyntaxKind::NAME};
6 6
7use crate::{ 7use crate::{
8 defs::{Definition, NameClass}, 8 defs::{Definition, NameClass},
9 symbol_index::{self, FileSymbol, Query as LocalImportablesQuery}, 9 symbol_index::{self, FileSymbol},
10 RootDatabase, 10 RootDatabase,
11}; 11};
12use either::Either; 12use either::Either;
@@ -22,12 +22,12 @@ pub fn find_exact_imports<'a>(
22 sema, 22 sema,
23 krate, 23 krate,
24 { 24 {
25 let mut local_query = LocalImportablesQuery::new(name_to_import.to_string()); 25 let mut local_query = symbol_index::Query::new(name_to_import.to_string());
26 local_query.exact(); 26 local_query.exact();
27 local_query.limit(40); 27 local_query.limit(40);
28 local_query 28 local_query
29 }, 29 },
30 ExternalImportablesQuery::new(name_to_import).anchor_end().case_sensitive().limit(40), 30 import_map::Query::new(name_to_import).anchor_end().case_sensitive().limit(40),
31 ) 31 )
32} 32}
33 33
@@ -42,19 +42,19 @@ pub fn find_similar_imports<'a>(
42 sema, 42 sema,
43 krate, 43 krate,
44 { 44 {
45 let mut local_query = LocalImportablesQuery::new(name_to_import.to_string()); 45 let mut local_query = symbol_index::Query::new(name_to_import.to_string());
46 local_query.limit(limit); 46 local_query.limit(limit);
47 local_query 47 local_query
48 }, 48 },
49 ExternalImportablesQuery::new(name_to_import).limit(limit), 49 import_map::Query::new(name_to_import).limit(limit),
50 ) 50 )
51} 51}
52 52
53fn find_imports<'a>( 53fn find_imports<'a>(
54 sema: &Semantics<'a, RootDatabase>, 54 sema: &Semantics<'a, RootDatabase>,
55 krate: Crate, 55 krate: Crate,
56 local_query: LocalImportablesQuery, 56 local_query: symbol_index::Query,
57 external_query: ExternalImportablesQuery, 57 external_query: import_map::Query,
58) -> impl Iterator<Item = Either<ModuleDef, MacroDef>> { 58) -> impl Iterator<Item = Either<ModuleDef, MacroDef>> {
59 let _p = profile::span("find_similar_imports"); 59 let _p = profile::span("find_similar_imports");
60 let db = sema.db; 60 let db = sema.db;