Update analysis.zig

This commit is contained in:
nullptrdevs 2022-08-22 10:54:29 -07:00 committed by GitHub
parent 4d0ab8b1aa
commit 015332b69e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2542,17 +2542,21 @@ fn makeInnerScope(allocator: std.mem.Allocator, context: ScopeContext, node_idx:
};
if (container_field) |_| {
if (!std.mem.eql(u8, name, "_") and !std.mem.eql(u8, name, "other")) {
try context.enums.put(allocator, .{
if (!std.mem.eql(u8, name, "_")) {
var doc = if (try getDocComments(allocator, tree, decl, .Markdown)) |docs|
types.MarkupContent{ .kind = .Markdown, .value = docs }
else
null;
var gop_res = try context.enums.getOrPut(allocator, .{
.label = name,
.kind = .Constant,
.insertText = name,
.insertTextFormat = .PlainText,
.documentation = if (try getDocComments(allocator, tree, decl, .Markdown)) |docs|
types.MarkupContent{ .kind = .Markdown, .value = docs }
else
null,
}, {});
.documentation = doc
});
if (gop_res.found_existing) {
if (doc) |d| allocator.free(d.value);
}
}
}
}