| author | |
| committer | |
| log | 27d2848e0096d31cb42cb258a89ed276ec26434e |
| tree | e338146e8097edfeecff5f2a42ccbdd5c16e9ae8 |
| parent | 6218e4004608000ba2e42e07ed1bd56745626820 |
fix rendering of fieldRef in exprName2 files changed, 22 insertions(+), 3 deletions(-)
lib/docs/main.js+3-3| ... | ... | @@ -1139,9 +1139,9 @@ const NAV_MODES = { |
| 1139 | 1139 | return exprName(switchIndex, opts); |
| 1140 | 1140 | } |
| 1141 | 1141 | case "fieldRef": { |
| 1142 | const enumObj = exprName({ type: expr.fieldRef.type }, opts); | |
| 1143 | const field = | |
| 1144 | getAstNode(enumObj.src).fields[expr.fieldRef.index]; | |
| 1142 | const field_idx = expr.fieldRef.index; | |
| 1143 | const type = getType(expr.fieldRef.type); | |
| 1144 | const field = getAstNode(type.src).fields[field_idx]; | |
| 1145 | 1145 | const name = getAstNode(field).name; |
| 1146 | 1146 | return name; |
| 1147 | 1147 | } |
src/Autodoc.zig+19| ... | ... | @@ -3616,6 +3616,25 @@ fn tryResolveRefPath( |
| 3616 | 3616 | continue :outer; |
| 3617 | 3617 | }, |
| 3618 | 3618 | }, |
| 3619 | .@"struct" => |st| { | |
| 3620 | for (st) |field| { | |
| 3621 | if (std.mem.eql(u8, field.name, child_string)) { | |
| 3622 | path[i + 1] = field.val.expr; | |
| 3623 | continue :outer; | |
| 3624 | } | |
| 3625 | } | |
| 3626 | ||
| 3627 | // if we got here, our search failed | |
| 3628 | printWithContext( | |
| 3629 | file, | |
| 3630 | inst_index, | |
| 3631 | "failed to match `{s}` in struct", | |
| 3632 | .{child_string}, | |
| 3633 | ); | |
| 3634 | ||
| 3635 | path[i + 1] = (try self.cteTodo("match failure")).expr; | |
| 3636 | continue :outer; | |
| 3637 | }, | |
| 3619 | 3638 | } |
| 3620 | 3639 | } |
| 3621 | 3640 |