mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +00:00
autodoc: Add handling for array_cat, array_mul, struct_init_empty_result. (#17367)
Fix issue with getting docs for src-less types in main.js
This commit is contained in:
parent
9f0d2f9417
commit
9c3165b81b
@ -3246,7 +3246,10 @@ Happy writing!
|
||||
const definitionDecl = getDecl(seenDecls[seenDecls.length - 1]);
|
||||
docs = getAstNode(definitionDecl.src).docs;
|
||||
} else {
|
||||
docs = getAstNode(getType(value.expr.type).src).docs;
|
||||
const type = getType(value.expr.type);
|
||||
if ("src" in type) {
|
||||
docs = getAstNode(type.src).docs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1547,7 +1547,6 @@ fn walkInstruction(
|
||||
};
|
||||
},
|
||||
|
||||
// @check array_cat and array_mul
|
||||
.add,
|
||||
.addwrap,
|
||||
.add_sat,
|
||||
@ -1564,9 +1563,8 @@ fn walkInstruction(
|
||||
.bit_or,
|
||||
.bit_and,
|
||||
.xor,
|
||||
// @check still not working when applied in std
|
||||
// .array_cat,
|
||||
// .array_mul,
|
||||
.array_cat,
|
||||
.array_mul,
|
||||
=> {
|
||||
const pl_node = data[inst_index].pl_node;
|
||||
const extra = file.zir.extraData(Zir.Inst.Bin, pl_node.payload_index);
|
||||
@ -2881,7 +2879,9 @@ fn walkInstruction(
|
||||
.expr = .{ .@"struct" = field_vals },
|
||||
};
|
||||
},
|
||||
.struct_init_empty => {
|
||||
.struct_init_empty,
|
||||
.struct_init_empty_result,
|
||||
=> {
|
||||
const un_node = data[inst_index].un_node;
|
||||
|
||||
var operand: DocData.WalkResult = try self.walkRef(
|
||||
|
Loading…
Reference in New Issue
Block a user