From 0f2f3a21e7e624f920d182869896347af309e909 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 25 Jan 2019 01:31:32 +0300 Subject: Migrate trait & type to new ids --- crates/ra_ide_api/src/completion/complete_path.rs | 7 +------ crates/ra_ide_api/src/completion/completion_item.rs | 8 +++----- 2 files changed, 4 insertions(+), 11 deletions(-) (limited to 'crates/ra_ide_api/src/completion') diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs index bd5484516..e72586e2e 100644 --- a/crates/ra_ide_api/src/completion/complete_path.rs +++ b/crates/ra_ide_api/src/completion/complete_path.rs @@ -40,12 +40,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { .add_to(acc) }); } - hir::ModuleDef::Function(_) - | hir::ModuleDef::Struct(_) - | hir::ModuleDef::Def(_) - | hir::ModuleDef::Const(_) - | hir::ModuleDef::Static(_) - | hir::ModuleDef::EnumVariant(_) => return, + _ => return, }; } diff --git a/crates/ra_ide_api/src/completion/completion_item.rs b/crates/ra_ide_api/src/completion/completion_item.rs index 2f8ec41d2..4e679281c 100644 --- a/crates/ra_ide_api/src/completion/completion_item.rs +++ b/crates/ra_ide_api/src/completion/completion_item.rs @@ -225,11 +225,9 @@ impl Builder { hir::ModuleDef::EnumVariant(it) => (CompletionItemKind::EnumVariant, it.docs(ctx.db)), hir::ModuleDef::Const(it) => (CompletionItemKind::Const, it.docs(ctx.db)), hir::ModuleDef::Static(it) => (CompletionItemKind::Static, it.docs(ctx.db)), - hir::ModuleDef::Def(def_id) => match def_id.resolve(ctx.db) { - hir::Def::Trait(it) => (CompletionItemKind::Trait, it.docs(ctx.db)), - hir::Def::Type(it) => (CompletionItemKind::TypeAlias, it.docs(ctx.db)), - _ => return self, - }, + hir::ModuleDef::Trait(it) => (CompletionItemKind::Trait, it.docs(ctx.db)), + hir::ModuleDef::Type(it) => (CompletionItemKind::TypeAlias, it.docs(ctx.db)), + hir::ModuleDef::Def(_) => return self, }; self.kind = Some(kind); self.documentation = docs; -- cgit v1.2.3