Formatter โ
Problem โ
Formatters must reproduce code with canonical spacing without changing meaning.
Why tree-sitter.zig helps โ
The tree gives exact spans for every construct; named/anonymous distinctions tell layout rules where whitespace is significant.
API โ
TreeCursor walk emitting node.text() plus layout rules per type.
Architecture โ
text
Parse โ walk โ emit with spacing rules โ verify by reparse