From 5d54aa678153d0af0edc8b4dd2d74709d10ca66c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 23 May 2019 20:18:47 +0300 Subject: add union to code_model --- crates/ra_ide_api/src/completion/complete_struct_literal.rs | 1 + crates/ra_ide_api/src/completion/presentation.rs | 1 + 2 files changed, 2 insertions(+) (limited to 'crates/ra_ide_api/src/completion') diff --git a/crates/ra_ide_api/src/completion/complete_struct_literal.rs b/crates/ra_ide_api/src/completion/complete_struct_literal.rs index 48fbf67f7..a00c1b60b 100644 --- a/crates/ra_ide_api/src/completion/complete_struct_literal.rs +++ b/crates/ra_ide_api/src/completion/complete_struct_literal.rs @@ -20,6 +20,7 @@ pub(super) fn complete_struct_literal(acc: &mut Completions, ctx: &CompletionCon } // FIXME unions + AdtDef::Union(_) => (), AdtDef::Enum(_) => (), }; } diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide_api/src/completion/presentation.rs index 9aa346688..064d379a4 100644 --- a/crates/ra_ide_api/src/completion/presentation.rs +++ b/crates/ra_ide_api/src/completion/presentation.rs @@ -63,6 +63,7 @@ impl Completions { return self.add_function_with_name(ctx, Some(local_name), *func); } Resolution::Def(Struct(it)) => (CompletionItemKind::Struct, it.docs(ctx.db)), + Resolution::Def(Union(it)) => (CompletionItemKind::Struct, it.docs(ctx.db)), Resolution::Def(Enum(it)) => (CompletionItemKind::Enum, it.docs(ctx.db)), Resolution::Def(EnumVariant(it)) => (CompletionItemKind::EnumVariant, it.docs(ctx.db)), Resolution::Def(Const(it)) => (CompletionItemKind::Const, it.docs(ctx.db)), -- cgit v1.2.3