codegen: add error printout for when codegen re-parse fails to facilitate debugging

This commit is contained in:
2026-02-14 18:33:41 -08:00
parent a101c7531b
commit cf989f7433

View File

@@ -73,7 +73,7 @@ func FprintWithComments(w io.Writer, file *ast.File) error {
fset = token.NewFileSet() fset = token.NewFileSet()
parsed, err := parser.ParseFile(fset, "", buf.Bytes(), parser.ParseComments) parsed, err := parser.ParseFile(fset, "", buf.Bytes(), parser.ParseComments)
if err != nil { if err != nil {
return fmt.Errorf("re-parsing pretty-print: %w", err) return fmt.Errorf("re-parsing pretty-print: %w\n\n%s", err, buf.String())
} }
// Parallel walk: apply TrailingComments from the side map. // Parallel walk: apply TrailingComments from the side map.