Skip to content

fix(transpiler): put case class's [derive(Eq, Show)] on its own line - #81

Merged
kthompson merged 2 commits into
mainfrom
t3code/7e2cd34b
Sep 9, 2026
Merged

kthompson merged 2 commits into
mainfrom
t3code/7e2cd34b

Conversation

@kthompson

Copy link
Copy Markdown
Owner

Summary

  • [derive(Eq, Show)] was written into the trailing trivia of Scala's case keyword (a single space), so it stayed on the same line as class. It now emits a newline plus the original indentation instead.
  • Regenerated the affected transpile snapshots (derive.pn, generics.pn) and the self-hosted pnc/src tree, since that's itself transpiled output that used the old one-line style.

Test plan

  • sbt "test/testOnly TranspileSnapshotTests" passes (4/4)
  • Confirmed sbt "pnc/compile"'s pre-existing 10 diagnostics are unrelated to this change (reproduced identically on the unmodified baseline via a temporary stash)

🤖 Generated with Claude Code

The attribute was written into the trailing trivia of Scala's `case`
keyword, which is just a single space, so `class` stayed on the same
line. It now forces a newline and reproduces the original indentation
instead. Regenerated the affected transpile snapshots and the
self-hosted pnc/src tree, which is itself transpiled output.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@kthompson
kthompson enabled auto-merge (rebase) September 9, 2026 04:34
scalafmt flagged the doc comment on the new currentLineIndentation
helper; reformatting it also required regenerating pnc/src/Transpiler.pn
to match. TranspilerTests.scala asserted the old same-line
[derive(Eq, Show)] format inline, separately from the snapshot suite,
and needed the same newline update.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@kthompson
kthompson merged commit e3faa9c into main Sep 9, 2026
3 of 4 checks passed
@kthompson
kthompson deleted the t3code/7e2cd34b branch September 9, 2026 04:59
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