Fixed enum completion bug
This commit is contained in:
parent
62774d065b
commit
e1bce76c63
@ -2044,10 +2044,11 @@ fn makeScopeInternal(
|
|||||||
|
|
||||||
if (node.cast(ast.Node.ContainerDecl)) |container| {
|
if (node.cast(ast.Node.ContainerDecl)) |container| {
|
||||||
const kind = tree.token_ids[container.kind_token];
|
const kind = tree.token_ids[container.kind_token];
|
||||||
if (empty_field and (kind == .Keyword_struct or (kind == .Keyword_union and container.init_arg_expr == .None))) {
|
if (kind == .Keyword_struct or (kind == .Keyword_union and container.init_arg_expr == .None)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!std.mem.eql(u8, name, "_")) {
|
||||||
(try enum_completions.addOne(allocator)).* = .{
|
(try enum_completions.addOne(allocator)).* = .{
|
||||||
.label = name,
|
.label = name,
|
||||||
.kind = .Constant,
|
.kind = .Constant,
|
||||||
@ -2058,6 +2059,7 @@ fn makeScopeInternal(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (try scopes.items[scope_idx].decls.fetchPut(name, .{ .ast_node = decl })) |existing| {
|
if (try scopes.items[scope_idx].decls.fetchPut(name, .{ .ast_node = decl })) |existing| {
|
||||||
// TODO Record a redefinition error.
|
// TODO Record a redefinition error.
|
||||||
|
Loading…
Reference in New Issue
Block a user