fix(format): keep every formatter rule within its line #210
No reviewers
Labels
No labels
bug
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gram-lang/gram!210
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/formatter-line-breaks"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #197. Closes #202.
Four formatter rules could reach past the end of a line, so formatting (including format-on-save) could change a recipe or make it unparseable:
@id {) and 7 (->&name {}) used\s+, so they could join a brace from the next line;\{([^}]*)\}, which ran on to the next}, however many lines down.They now stick to spaces/tabs and
[^{}\n]*, like rules 4 and 4b already did. Stopping at the next{also makes formatting linear on unclosed braces (#202).Fuzz:
fuzz/regressions/(each one fails on main with its original signature);nested opening bracesleavesKNOWN_SLOW;trimEndbut not by the parser) and #208 (a composite parent keeps its source case:@l<@N).bun run fuzz --iterations 30000 --seed 2111373929: 0 new signatures. Tests for format, fuzz, LSP and CLI all pass.