aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2020-12-07 22:46:56 +0000
committerKirill Bulatov <[email protected]>2020-12-07 23:07:20 +0000
commit3183ff3a7b1fbcf3cb5379cf162a3d769a21be7a (patch)
tree5aa366155109b6f564f0f0a021fe2e43c0ac1bc9 /crates/ide_db
parent9656ceb8963273047dab4ee9f3d0b19976890599 (diff)
Disable the completion for no corresponding client resolve capabilities
Diffstat (limited to 'crates/ide_db')
-rw-r--r--crates/ide_db/src/imports_locator.rs14
1 files changed, 2 insertions, 12 deletions
diff --git a/crates/ide_db/src/imports_locator.rs b/crates/ide_db/src/imports_locator.rs
index 09046d3c3..31151ce24 100644
--- a/crates/ide_db/src/imports_locator.rs
+++ b/crates/ide_db/src/imports_locator.rs
@@ -35,26 +35,16 @@ pub fn find_similar_imports<'a>(
35 sema: &Semantics<'a, RootDatabase>, 35 sema: &Semantics<'a, RootDatabase>,
36 krate: Crate, 36 krate: Crate,
37 name_to_import: &str, 37 name_to_import: &str,
38 limit: usize,
39 ignore_modules: bool, 38 ignore_modules: bool,
40) -> impl Iterator<Item = Either<ModuleDef, MacroDef>> { 39) -> impl Iterator<Item = Either<ModuleDef, MacroDef>> {
41 let _p = profile::span("find_similar_imports"); 40 let _p = profile::span("find_similar_imports");
42 41
43 let mut external_query = import_map::Query::new(name_to_import).limit(limit); 42 let mut external_query = import_map::Query::new(name_to_import);
44 if ignore_modules { 43 if ignore_modules {
45 external_query = external_query.exclude_import_kind(import_map::ImportKind::Module); 44 external_query = external_query.exclude_import_kind(import_map::ImportKind::Module);
46 } 45 }
47 46
48 find_imports( 47 find_imports(sema, krate, symbol_index::Query::new(name_to_import.to_string()), external_query)
49 sema,
50 krate,
51 {
52 let mut local_query = symbol_index::Query::new(name_to_import.to_string());
53 local_query.limit(limit);
54 local_query
55 },
56 external_query,
57 )
58} 48}
59 49
60fn find_imports<'a>( 50fn find_imports<'a>(