Skip to content

fix(formatter): preserve prefix quantities after semicolons - #2065

Draft
sebastian-griego wants to merge 1 commit into
bendlang:mainfrom
sebastian-griego:fix/formatter-semicolon-prefixes
Draft

sebastian-griego wants to merge 1 commit into
bendlang:mainfrom
sebastian-griego:fix/formatter-semicolon-prefixes

Conversation

@sebastian-griego

Copy link
Copy Markdown
Contributor

The formatter changes valid (x = &0; &1) to (x = &0; & 1), which Bend rejects. A semicolon starts a new body, but the formatter did not include it in PREFIX_CONTEXT. Add the missing marker so the existing prefix rule preserves the quantity literal.

Add six cases for &0, &1, and &2, with adjacent and spaced semicolons and trailing comments. The existing test harness checks exact formatting, idempotence, and equal Bend output with default spaces, four spaces, and tabs.

Validation:

  • npm test: TypeScript build and all 35 formatter/LSP tests pass; none skipped.
  • The same tests with the old formatter fail on both exact formatting and actual Bend execution.
  • Both affected repository fixtures, let_dependent_type.bend and let_unsafe_dependent_type.bend, check after formatting.
  • bun gates/repo.ts: 56/56 pass. git diff --check passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant