//
// To avoid an excessive amount of the results returned, completion input is checked for inclusion in the names only
// (i.e. in `HashMap` in the `std::collections::HashMap` path).
+// For the same reasons, avoids searching for any imports for inputs with their length less that 2 symbols.
//
// .Merge Behavior
//
let _p = profile::span("fuzzy_completion");
let potential_import_name = ctx.token.to_string();
+ if potential_import_name.len() < 2 {
+ return None;
+ }
+
let current_module = ctx.scope.module()?;
let anchor = ctx.name_ref_syntax.as_ref()?;
let import_scope = ImportScope::find_insert_use_container(anchor.syntax(), &ctx.sema)?;
let mut all_mod_paths = imports_locator::find_similar_imports(
&ctx.sema,
ctx.krate?,
- Some(100),
+ Some(40),
&potential_import_name,
true,
)