aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2021-01-04 16:33:05 +0000
committerKirill Bulatov <[email protected]>2021-01-04 16:33:05 +0000
commitca42a52051e69d441b3f32ba4268286a8f0d8685 (patch)
tree217c9b610f657a3b60833c4e7b1c0bbf5c29d122 /crates/completion/src
parented1ef3ae13a8f7bc2144bd06d0271d9a6e3205a0 (diff)
Code review fixes
Diffstat (limited to 'crates/completion/src')
-rw-r--r--crates/completion/src/completions/unqualified_path.rs11
1 files changed, 2 insertions, 9 deletions
diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs
index 068b6b407..f376ded57 100644
--- a/crates/completion/src/completions/unqualified_path.rs
+++ b/crates/completion/src/completions/unqualified_path.rs
@@ -3,7 +3,7 @@
3use std::iter; 3use std::iter;
4 4
5use either::Either; 5use either::Either;
6use hir::{Adt, AsAssocItem, ModPath, ModuleDef, ScopeDef, Type}; 6use hir::{Adt, ModPath, ModuleDef, ScopeDef, Type};
7use ide_db::helpers::insert_use::ImportScope; 7use ide_db::helpers::insert_use::ImportScope;
8use ide_db::imports_locator; 8use ide_db::imports_locator;
9use syntax::AstNode; 9use syntax::AstNode;
@@ -142,15 +142,8 @@ fn fuzzy_completion(acc: &mut Completions, ctx: &CompletionContext) -> Option<()
142 Some(40), 142 Some(40),
143 potential_import_name, 143 potential_import_name,
144 true, 144 true,
145 true,
145 ) 146 )
146 .filter(|import_candidate| match import_candidate {
147 Either::Left(ModuleDef::Function(function)) => function.as_assoc_item(ctx.db).is_none(),
148 Either::Left(ModuleDef::Const(const_)) => const_.as_assoc_item(ctx.db).is_none(),
149 Either::Left(ModuleDef::TypeAlias(type_alias)) => {
150 type_alias.as_assoc_item(ctx.db).is_none()
151 }
152 _ => true,
153 })
154 .filter_map(|import_candidate| { 147 .filter_map(|import_candidate| {
155 Some(match import_candidate { 148 Some(match import_candidate {
156 Either::Left(module_def) => { 149 Either::Left(module_def) => {