Expand description
Post-edit syntax gate (#1008): a tree-sitter parse check used to reject an edit that turns a cleanly parsing file into a broken one.
Principle (plan Säule 3): only the clean → broken transition is a real
regression. We never reject when the pre-edit file already had parse errors
(the model may be fixing them), and we skip entirely for languages without a
grammar — so the gate is a safety net, never an obstacle. The decision logic
lives in gate_edit; check_syntax is the raw parse probe.
Structs§
- Syntax
Check - Outcome of a tree-sitter parse probe.
Functions§
- check_
syntax - Parse
contentasextand report whether the tree has syntax errors. - gate_
edit - The post-edit gate decision (#1008). Returns
Some(reason)only for the clean → broken regression — the single case worth blocking — andNone(allow the write) for every other situation: unsupported language, tree-sitter off, an already-broken pre-edit file, or a post-edit file that still parses.