Filter out non-type completions in the respective completions modules instead

This commit is contained in:
Lukas Wirth 2021-06-16 15:08:44 +02:00
parent 79703efc7f
commit 354ad29493
6 changed files with 95 additions and 72 deletions

View file

@ -55,9 +55,6 @@ pub(crate) fn render_resolution_with_import(
import_edit: ImportEdit,
) -> Option<CompletionItem> {
let resolution = hir::ScopeDef::from(import_edit.import.original_item);
if ctx.completion.expects_type() && resolution.is_value_def() {
return None;
}
let local_name = match resolution {
hir::ScopeDef::ModuleDef(hir::ModuleDef::Function(f)) => f.name(ctx.completion.db),
hir::ScopeDef::ModuleDef(hir::ModuleDef::Const(c)) => c.name(ctx.completion.db)?,