From 8457487b2e77cd1323cf6ff72e8616d3b255ac54 Mon Sep 17 00:00:00 2001 From: Techatrix <19954306+Techatrix@users.noreply.github.com> Date: Sat, 20 Aug 2022 18:28:41 +0200 Subject: [PATCH] better handling for enum field signatures --- src/analysis.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/analysis.zig b/src/analysis.zig index c9c99f6..3c827a2 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -222,6 +222,9 @@ pub fn getVariableSignature(tree: Ast, var_decl: Ast.full.VarDecl) []const u8 { } pub fn getContainerFieldSignature(tree: Ast, field: Ast.full.ContainerField) []const u8 { + if(field.ast.value_expr == 0 and field.ast.type_expr == 0 and field.ast.align_expr == 0) { + return ""; // TODO display the container's type + } const start = offsets.tokenLocation(tree, field.ast.name_token).start; const end_node = if (field.ast.value_expr != 0) field.ast.value_expr else field.ast.type_expr; const end = offsets.tokenLocation(tree, ast.lastToken(tree, end_node)).end;