authorgravatar for der.teufel.mail@gmail.comKrzysztof Wolicki <der.teufel.mail@gmail.com> 2023-10-04 18:25:00+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2023-10-04 18:25:00+02:00
log9c3165b81b1ee6474f4bdecf33149f587fd77510
tree389a1767aa7c4189223caca6829505d35fbb4c8c
parent9f0d2f94175a131d965e86a6396f5ac508b27bf8
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

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

2 files changed, 9 insertions(+), 6 deletions(-)

lib/docs/main.js+4-1
......@@ -3246,7 +3246,10 @@ Happy writing!
32463246 const definitionDecl = getDecl(seenDecls[seenDecls.length - 1]);
32473247 docs = getAstNode(definitionDecl.src).docs;
32483248 } else {
3249 docs = getAstNode(getType(value.expr.type).src).docs;
3249 const type = getType(value.expr.type);
3250 if ("src" in type) {
3251 docs = getAstNode(type.src).docs;
3252 }
32503253 }
32513254 }
32523255
src/Autodoc.zig+5-5
......@@ -1547,7 +1547,6 @@ fn walkInstruction(
15471547 };
15481548 },
15491549
1550 // @check array_cat and array_mul
15511550 .add,
15521551 .addwrap,
15531552 .add_sat,
......@@ -1564,9 +1563,8 @@ fn walkInstruction(
15641563 .bit_or,
15651564 .bit_and,
15661565 .xor,
1567 // @check still not working when applied in std
1568 // .array_cat,
1569 // .array_mul,
1566 .array_cat,
1567 .array_mul,
15701568 => {
15711569 const pl_node = data[inst_index].pl_node;
15721570 const extra = file.zir.extraData(Zir.Inst.Bin, pl_node.payload_index);
......@@ -2881,7 +2879,9 @@ fn walkInstruction(
28812879 .expr = .{ .@"struct" = field_vals },
28822880 };
28832881 },
2884 .struct_init_empty => {
2882 .struct_init_empty,
2883 .struct_init_empty_result,
2884 => {
28852885 const un_node = data[inst_index].un_node;
28862886
28872887 var operand: DocData.WalkResult = try self.walkRef(