Commit 7a0e7b5
committed
Fix formatter blank-line growth between doc comments and items
Two formatter idempotency bugs:
1. Doc comment → attribute/item: `emit_blank_lines_to` preserved blank
lines from the source between a doc comment and its item's attribute,
causing blank lines to grow on each format pass. Fixed by skipping
blank-line insertion when the last leading comment was a doc comment.
2. World declaration body: `last_source_line` was not updated after
emitting `{\n`, causing the first import block to get an extra blank
line on each pass. Fixed by setting `last_source_line` after the `{`.
https://claude.ai/code/session_0181NuipeuMorkJgDi4dh3Dp1 parent baafe5b commit 7a0e7b5
2 files changed
+23
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
120 | 124 | | |
121 | 125 | | |
122 | 126 | | |
| |||
1047 | 1051 | | |
1048 | 1052 | | |
1049 | 1053 | | |
| 1054 | + | |
1050 | 1055 | | |
1051 | 1056 | | |
1052 | 1057 | | |
| |||
2538 | 2543 | | |
2539 | 2544 | | |
2540 | 2545 | | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
2541 | 2562 | | |
2542 | 2563 | | |
2543 | 2564 | | |
| |||
0 commit comments