fix(tuigen): handle let bindings with call or expression RHS and keep component expression comments
Fixes three bugs surfaced while writing coverage tests:
The analyzer dereferenced LetBinding.Element without a nil check in four
walk sites (validateRefs, containsChildrenSlot, transformNode, and
DetectStateBindings), so a let binding whose RHS is a component call,
like badge := @Badge(hi) in a function templ, crashed tui generate
with a nil pointer panic. The walks now branch on Element vs Call and
descend into call children.
The parser's attachLeadingComments switch had no ComponentExpr case, so
a comment directly above @c.field was silently dropped by the formatter.
printOrphanComments emitted a separator blank line between comment
groups even though the first comment of each group already carries
BlankLineBefore, producing a double blank line on the first format pass
and breaking idempotency.
grindlemire · Jun 11 · f0bb13a · parent 21be938 · 7 files +110 -4