diff --git a/crates/completion/src/completions.rs b/crates/completion/src/completions.rs index 99db5f9980..4abb101564 100644 --- a/crates/completion/src/completions.rs +++ b/crates/completion/src/completions.rs @@ -13,7 +13,7 @@ pub(crate) mod postfix; pub(crate) mod macro_in_item_position; pub(crate) mod trait_impl; pub(crate) mod mod_; -pub(crate) mod complete_magic; +pub(crate) mod magic; use hir::{ModPath, ScopeDef, Type}; diff --git a/crates/completion/src/completions/complete_magic.rs b/crates/completion/src/completions/magic.rs similarity index 92% rename from crates/completion/src/completions/complete_magic.rs rename to crates/completion/src/completions/magic.rs index 58509fc5ba..34fc358470 100644 --- a/crates/completion/src/completions/complete_magic.rs +++ b/crates/completion/src/completions/magic.rs @@ -11,7 +11,7 @@ use crate::{context::CompletionContext, item::CompletionKind, CompletionItem, Co use super::Completions; -// TODO kb when typing, completes partial results, need to rerun manually to see the proper ones +// TODO kb add a setting toggle for this feature? pub(crate) fn complete_magic(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> { if !(ctx.is_trivial_path || ctx.is_pat_binding_or_const) { return None; @@ -20,8 +20,6 @@ pub(crate) fn complete_magic(acc: &mut Completions, ctx: &CompletionContext) -> let anchor = ctx.name_ref_syntax.as_ref()?; let import_scope = ImportScope::find_insert_use_container(anchor.syntax(), &ctx.sema)?; - // TODO kb consider heuristics, such as "don't show `hash_map` import if `HashMap` is the import for completion" - // also apply completion ordering let potential_import_name = ctx.token.to_string(); let possible_imports = ctx @@ -34,8 +32,6 @@ pub(crate) fn complete_magic(acc: &mut Completions, ctx: &CompletionContext) -> Either::Left(module_def) => current_module.find_use_path(ctx.db, module_def), Either::Right(macro_def) => current_module.find_use_path(ctx.db, macro_def), }?; - // TODO kb need to omit braces when there are some already. - // maybe remove braces completely? Some((use_path, additional_completion(ctx.db, import_candidate))) }) .filter_map(|(mod_path, additional_completion)| {