mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
autodoc: update to new func zir body structure
this is a hack meant to restore functionality for the upcoming release, a proper analysis of the new zir structure is required to make a robust change.
This commit is contained in:
parent
2b25d3c333
commit
d4487b6a2e
2 changed files with 9 additions and 1 deletions
|
|
@ -449,6 +449,8 @@ var zigAnalysis;
|
|||
currentType = childDecl;
|
||||
curNav.declObjs.push(currentType);
|
||||
}
|
||||
|
||||
window.x = currentType;
|
||||
|
||||
renderNav();
|
||||
|
||||
|
|
|
|||
|
|
@ -950,6 +950,12 @@ fn walkInstruction(
|
|||
need_type,
|
||||
);
|
||||
},
|
||||
.ret_type => {
|
||||
return DocData.WalkResult{
|
||||
.typeRef = .{ .type = @enumToInt(Ref.type_type) },
|
||||
.expr = .{ .type = @enumToInt(Ref.type_type) },
|
||||
};
|
||||
},
|
||||
.ret_node => {
|
||||
const un_node = data[inst_index].un_node;
|
||||
return self.walkRef(file, parent_scope, parent_src, un_node.operand, false);
|
||||
|
|
@ -3987,7 +3993,7 @@ fn getGenericReturnType(
|
|||
body_end: usize,
|
||||
) !DocData.Expr {
|
||||
// TODO: compute the correct line offset
|
||||
const wr = try self.walkInstruction(file, scope, parent_src, body_end, false);
|
||||
const wr = try self.walkInstruction(file, scope, parent_src, body_end - 3, false);
|
||||
return wr.expr;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue