Skip to content

refactor(formatter)!: replace TabIfBreak with standard indentation - #1822

Open
magic-akari wants to merge 3 commits into
mainfrom
refactor/tuple-union-indent
Open

magic-akari wants to merge 3 commits into
mainfrom
refactor/tuple-union-indent

Conversation

@magic-akari

Copy link
Copy Markdown
Member

Motivation

SWC used TabIfBreak to indent the first | when a union wraps inside a TypeScript tuple. The Prettier plugin decoded it as ifBreak("\t"), so the two printers measured the same line differently. At a print width of 14, SWC broke after Ref< while Prettier kept Ref<A, B> on one line.

Changes

  • Apply indentIfBreak to the line break after the tuple comma. A named group lets the printer decide whether the conditional type head fits and indent the first | using the active tab or space settings.
  • Remove the public Rust method Writer::tab_indent_if_break, its printer special case, and SWCD opcode 30 from the Rust codec and JS decoder. Rust callers can wrap the preceding line break in Writer::indent_if_break.
  • Verify that both SWC → Prettier → SWC and Prettier → SWC → Prettier preserve the tuple’s printed output across 40 combinations of print width, tab width, indentation style, and line ending on native and Wasm.

The Prettier plugin decoded TabIfBreak as a literal tab, so the two
printers could wrap the first union member at different columns.

Use a named group to measure the conditional type head at print time
and apply indentIfBreak to the line after the tuple comma. Remove
Writer::tab_indent_if_break, the printer special case, and opcode 30
from the SWCD codecs.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Deploying swc-next with  Cloudflare Pages  Cloudflare Pages

Latest commit: c15b044
Status: ✅  Deploy successful!
Preview URL: https://a66198b7.swc-next.pages.dev
Branch Preview URL: https://refactor-tuple-union-indent.swc-next.pages.dev

View logs

@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Binary size diff

Linux x64 GNU · release · uncompressed, stripped bindings.

Merge: 977d2b2bd8210950e185d8cb9c28b35c74908a01; base: f6f4151d645e55d9271991b0fbfc87f940ed3197.

Artifact Merge Base Change (bytes) Change (%)
@swc-next/core 4,437.44 KiB 4,437.44 KiB 0 0.000% ⚪
@swc-next/parser 1,387.63 KiB 1,387.63 KiB 0 0.000% ⚪
@swc-next/generator 603.15 KiB 603.15 KiB 0 0.000% ⚪
@swc-next/transformer 4,408.69 KiB 4,408.69 KiB 0 0.000% ⚪

@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Gungraun benchmark diff

Base SHA: f6f4151
Compare SHA: 977d2b2

Values are shown as compare / base.

Download the raw Gungraun and Valgrind data (retained for 90 days).

Callgrind metric changes

Callgrind instruction counts (Ir) for the compare and base revisions. Values are shown as compare / base in K (1,000), truncated to whole thousands. Multi-part profiles use the part numbers from Gungraun and include an aggregated Total. New and Removed identify benchmarks that exist on only one side; the missing value is shown as a dash. Percentages are rounded to at most three decimal places. Lower is better: 🟢 improvement, 🔴 regression, ⚪ unchanged.

Formatter
Benchmark Ir (K) Change
formatter/angular 73,620 / 73,639 −0.025% 🟢
formatter/astro_config 4,348 / 4,348 −0.001% 🟢
formatter/backbone 11,032 / 11,034 −0.017% 🟢
formatter/effect_schema_ast 23,714 / 23,717 −0.015% 🟢
formatter/hono_types 15,988 / 16,031 −0.27% 🟢
formatter/jquery_mobile 94,978 / 95,000 −0.023% 🟢
formatter/mootools 47,040 / 47,050 −0.021% 🟢
formatter/three 255,060 / 255,137 −0.03% 🟢
formatter/typescript 1,427,194 / 1,427,687 −0.035% 🟢
formatter/underscore 9,871 / 9,873 −0.023% 🟢
formatter/yui 46,442 / 46,445 −0.008% 🟢
markdown_formatter/biome_readme 287 / 287 +0.037% 🔴
markdown_formatter/nix_changelog 4,706 / 4,706 −0.005% 🟢
markdown_formatter/prettier_options 1,062 / 1,062 +0.009% 🔴
Generator
Benchmark Ir (K) Change
cal_com_tsx 49,266 / 49,266 0% ⚪
typescript 371,374 / 371,377 −0.001% 🟢
Minifier
Benchmark Ir (K) Change
angular 19,086 / 19,086 −0.002% 🟢
semantic 43 / 43 0% ⚪
typescript 385,846 / 385,851 −0.001% 🟢
underscore 2,777 / 2,777 −0.002% 🟢
Parser
Benchmark Ir (K) Change
markdown_parser/biome_readme 316 / 316 +0.005% 🔴
markdown_parser/nix_changelog 8,110 / 8,110 0% ⚪
markdown_parser/prettier_options 1,601 / 1,601 +0.027% 🔴
parser/angular 7,972 / 7,971 +0.005% 🔴
parser/backbone 1,267 / 1,267 −0.009% 🟢
parser/cal_com_tsx 25,103 / 25,103 0% ⚪
parser/hono_types 2,898 / 2,898 0% ⚪
parser/jquery 6,669 / 6,668 +0.004% 🔴
parser/jquery_mobile 10,303 / 10,304 −0.007% 🟢
parser/mootools 5,499 / 5,499 −0.001% 🟢
parser/three 32,274 / 32,274 0% ⚪
parser/typescript 162,355 / 162,356 0% ⚪
parser/underscore 1,131 / 1,131 +0.011% 🔴
parser/yui 5,176 / 5,176 0% ⚪
Semantic
Benchmark Ir (K) Change
analyze/cal_com_tsx 15,946 / 15,945 +0.008% 🔴
analyze/typescript 129,365 / 129,370 −0.004% 🟢
analyze/typescript_checker 55,496 / 55,504 −0.013% 🟢
syntax_check/cal_com_tsx 26,801 / 26,800 +0.005% 🔴
syntax_check/typescript 178,133 / 178,137 −0.003% 🟢
syntax_check/typescript_checker 70,132 / 70,140 −0.01% 🟢
Transform
Benchmark Ir (K) Change
transform/excalidraw_app 34,246 / 34,246 −0.001% 🟢
transform/hono_types 12,715 / 12,716 −0.013% 🟢
transform/kitchen_sink 112,549 / 112,547 +0.002% 🔴
transform/radix_ui_adoption 346 / 346 −0.03% 🟢
transform/three 127,189 / 127,191 −0.001% 🟢
transform_v1/excalidraw_app 76,419 / 76,403 +0.021% 🔴
transform_v1/hono_types 593 / 593 −0.027% 🟢
transform_v1/kitchen_sink 146,186 / 146,207 −0.014% 🟢
transform_v1/radix_ui_adoption 612 / 612 −0.025% 🟢
transform_v1/three 240,871 / 240,875 −0.001% 🟢
Type strip
Benchmark Ir (K) Change
astro_config/Part 1 369 / 369 −0.013% 🟢
astro_config/Part 2 158 / 158 0% ⚪
astro_config/Total 527 / 527 −0.009% 🟢
effect_schema_ast/Part 1 2,985 / 2,985 −0.002% 🟢
effect_schema_ast/Part 2 675 / 675 0% ⚪
effect_schema_ast/Total 3,661 / 3,661 −0.001% 🟢
hono_types/Part 1 2,891 / 2,891 0% ⚪
hono_types/Part 2 112 / 112 0% ⚪
hono_types/Total 3,003 / 3,003 0% ⚪
Visit
Benchmark Ir (K) Change
traverse/cal_com_tsx 2,826 / 2,826 0% ⚪
traverse/typescript 25,822 / 25,822 0% ⚪
visit/cal_com_tsx 2,874 / 2,874 0% ⚪
visit/typescript 25,119 / 25,119 0% ⚪
visit_mut/cal_com_tsx 2,555 / 2,555 0% ⚪
visit_mut/typescript 24,288 / 24,288 0% ⚪
Benchmark results
gungraun::parser::bench_parser angular:(ANGULAR, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                    7972020|7971657              (+0.00455%) [+1.00005x]
gungraun::parser::bench_parser backbone:(BACKBONE, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                    1267478|1267593              (-0.00907%) [-1.00009x]
gungraun::parser::bench_parser jquery:(JQUERY, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                    6669089|6668819              (+0.00405%) [+1.00004x]
gungraun::parser::bench_parser jquery_mobile:(JQUERY_MOBILE, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                   10303422|10304129             (-0.00686%) [-1.00007x]
gungraun::parser::bench_parser mootools:(MOOTOOLS, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                    5499943|5499972              (-0.00053%) [-1.00001x]
gungraun::parser::bench_parser underscore:(UNDERSCORE, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                    1131977|1131858              (+0.01051%) [+1.00011x]
gungraun::parser::bench_parser three:(THREE, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                   32274984|32274998             (-0.00004%) [-1.00000x]
gungraun::parser::bench_parser yui:(YUI, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                    5176315|5176318              (-0.00006%) [-1.00000x]
gungraun::parser::bench_parser typescript:(TYPESCRIPT, Lang :: Js)
  Baselines:                                              |base
  Instructions:                                  162355768|162356112            (-0.00021%) [-1.00000x]
gungraun::parser::bench_parser cal_com_tsx:(CAL_COM_TSX, Lang :: Tsx)
  Baselines:                                              |base
  Instructions:                                   25103474|25103498             (-0.00010%) [-1.00000x]
gungraun::parser::bench_parser hono_types:(HONO_TYPES, Lang :: Ts)
  Baselines:                                              |base
  Instructions:                                    2898672|2898683              (-0.00038%) [-1.00000x]
gungraun::parser::bench_markdown_parser biome_readme:(BIOME_README)
  Baselines:                                              |base
  Instructions:                                     316337|316321               (+0.00506%) [+1.00005x]
gungraun::parser::bench_markdown_parser prettier_options:(PRETTIER_OPTIONS)
  Baselines:                                              |base
  Instructions:                                    1601578|1601143              (+0.02717%) [+1.00027x]
gungraun::parser::bench_markdown_parser nix_changelog:(NIX_CHANGELOG)
  Baselines:                                              |base
  Instructions:                                    8110552|8110561              (-0.00011%) [-1.00000x]
gungraun::semantic::bench_analyze typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                  129365312|129370044            (-0.00366%) [-1.00004x]
gungraun::semantic::bench_analyze cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                                              |base
  Instructions:                                   15946466|15945131             (+0.00837%) [+1.00008x]
gungraun::semantic::bench_analyze typescript_checker:(setup_program(TYPESCRIPT_CHECKER, Lang :: Ts))
  Baselines:                                              |base
  Instructions:                                   55496968|55504277             (-0.01317%) [-1.00013x]
gungraun::semantic::bench_syntax_check typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                  178133452|178137980            (-0.00254%) [-1.00003x]
gungraun::semantic::bench_syntax_check cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                                              |base
  Instructions:                                   26801963|26800492             (+0.00549%) [+1.00005x]
gungraun::semantic::bench_syntax_check typescript_checker:(setup_program(TYPESCRIPT_CHECKER, Lang :: Ts))
  Baselines:                                              |base
  Instructions:                                   70132815|70140112             (-0.01040%) [-1.00010x]
gungraun::generator::bench_generate typescript:(setup_generate(TYPESCRIPT, "typescript.js"))
  Baselines:                                              |base
  Instructions:                                  371374987|371377611            (-0.00071%) [-1.00001x]
gungraun::generator::bench_generate cal_com_tsx:(setup_generate(CAL_COM_TSX, "cal.com.tsx"))
  Baselines:                                              |base
  Instructions:                                   49266378|49266242             (+0.00028%) [+1.00000x]
gungraun::formatter::bench_formatter angular:(setup_formatter_program(ANGULAR, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   73620722|73639427             (-0.02540%) [-1.00025x]
gungraun::formatter::bench_formatter backbone:(setup_formatter_program(BACKBONE, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   11032988|11034832             (-0.01671%) [-1.00017x]
gungraun::formatter::bench_formatter jquery_mobile:(setup_formatter_program(JQUERY_MOBILE, Lang :: Js...
  Baselines:                                              |base
  Instructions:                                   94978748|95000681             (-0.02309%) [-1.00023x]
gungraun::formatter::bench_formatter mootools:(setup_formatter_program(MOOTOOLS, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   47040462|47050380             (-0.02108%) [-1.00021x]
gungraun::formatter::bench_formatter underscore:(setup_formatter_program(UNDERSCORE, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                    9871421|9873654              (-0.02262%) [-1.00023x]
gungraun::formatter::bench_formatter three:(setup_formatter_program(THREE, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                  255060398|255137090            (-0.03006%) [-1.00030x]
gungraun::formatter::bench_formatter yui:(setup_formatter_program(YUI, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   46442131|46445990             (-0.00831%) [-1.00008x]
gungraun::formatter::bench_formatter typescript:(setup_formatter_program(TYPESCRIPT, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                 1427194390|1427687028           (-0.03451%) [-1.00035x]
gungraun::formatter::bench_formatter astro_config:(setup_formatter_program(ASTRO_CONFIG, Lang :: Ts)...
  Baselines:                                              |base
  Instructions:                                    4348455|4348503              (-0.00110%) [-1.00001x]
gungraun::formatter::bench_formatter effect_schema_ast:(setup_formatter_program(EFFECT_SCHEMA_AST, Lang :...
  Baselines:                                              |base
  Instructions:                                   23714176|23717670             (-0.01473%) [-1.00015x]
gungraun::formatter::bench_formatter hono_types:(setup_formatter_program(HONO_TYPES, Lang :: Ts))
  Baselines:                                              |base
  Instructions:                                   15988231|16031474             (-0.26974%) [-1.00270x]
gungraun::formatter::bench_markdown_formatter biome_readme:(parse_markdown(BIOME_README))
  Baselines:                                              |base
  Instructions:                                     287214|287109               (+0.03657%) [+1.00037x]
gungraun::formatter::bench_markdown_formatter prettier_options:(parse_markdown(PRETTIER_OPTIONS))
  Baselines:                                              |base
  Instructions:                                    1062488|1062393              (+0.00894%) [+1.00009x]
gungraun::formatter::bench_markdown_formatter nix_changelog:(parse_markdown(NIX_CHANGELOG))
  Baselines:                                              |base
  Instructions:                                    4706015|4706230              (-0.00457%) [-1.00005x]
gungraun::minifier::bench_minifier underscore:(setup_minifier(UNDERSCORE))
  Baselines:                                              |base
  Instructions:                                    2777779|2777841              (-0.00223%) [-1.00002x]
gungraun::minifier::bench_minifier angular:(setup_minifier(ANGULAR))
  Baselines:                                              |base
  Instructions:                                   19086366|19086688             (-0.00169%) [-1.00002x]
gungraun::minifier::bench_minifier typescript:(setup_minifier(TYPESCRIPT))
  Baselines:                                              |base
  Instructions:                                  385846779|385851543            (-0.00123%) [-1.00001x]
gungraun::minifier::bench_minifier semantic:(setup_minifier(MINIFIER_SEMANTIC))
  Baselines:                                              |base
  Instructions:                                      43050|43050                (No change)
gungraun::transform::bench_transform three:(setup_transform(THREE, "three-0.138.3.js"))
  Baselines:                                              |base
  Instructions:                                  127189706|127191136            (-0.00112%) [-1.00001x]
gungraun::transform::bench_transform excalidraw_app:(setup_transform(EXCALIDRAW_APP, "App.tsx"))
  Baselines:                                              |base
  Instructions:                                   34246234|34246665             (-0.00126%) [-1.00001x]
gungraun::transform::bench_transform radix_ui_adoption:(setup_transform(RADIX_UI_ADOPTION, "RadixUIAdopti...
  Baselines:                                              |base
  Instructions:                                     346520|346625               (-0.03029%) [-1.00030x]
gungraun::transform::bench_transform hono_types:(setup_transform(HONO_TYPES, "hono-types.ts"))
  Baselines:                                              |base
  Instructions:                                   12715238|12716830             (-0.01252%) [-1.00013x]
gungraun::transform::bench_transform kitchen_sink:(setup_transform(KITCHEN_SINK, "kitchen-sink.tsx")...
  Baselines:                                              |base
  Instructions:                                  112549786|112547865            (+0.00171%) [+1.00002x]
gungraun::transform::bench_transform_v1 three:(setup_transform_v1(THREE, "three-0.138.3.js"))
  Baselines:                                              |base
  Instructions:                                  240871979|240875314            (-0.00138%) [-1.00001x]
gungraun::transform::bench_transform_v1 excalidraw_app:(setup_transform_v1(EXCALIDRAW_APP, "App.tsx"))
  Baselines:                                              |base
  Instructions:                                   76419330|76403082             (+0.02127%) [+1.00021x]
gungraun::transform::bench_transform_v1 radix_ui_adoption:(setup_transform_v1(RADIX_UI_ADOPTION, "RadixUIAdo...
  Baselines:                                              |base
  Instructions:                                     612245|612398               (-0.02498%) [-1.00025x]
gungraun::transform::bench_transform_v1 hono_types:(setup_transform_v1(HONO_TYPES, "hono-types.ts"))
  Baselines:                                              |base
  Instructions:                                     593344|593506               (-0.02730%) [-1.00027x]
gungraun::transform::bench_transform_v1 kitchen_sink:(setup_transform_v1(KITCHEN_SINK, "kitchen-sink.ts...
  Baselines:                                              |base
  Instructions:                                  146186548|146207130            (-0.01408%) [-1.00014x]
gungraun::type_strip::bench_type_strip astro_config:(ASTRO_CONFIG, type_strip_options(Lang :: Ts))
  ## pid: 5737 thread: 1 part: 1                          |pid: 5659 thread: 1 part: 1
  Command:
                                      /home/runner/work/_temp/gungraun-bin/head/gungraun|/home/runner/work/_temp/gungraun-bin/base/gungraun --gungraun-run d:d:000000 00006 00000 00000
  Baselines:                                              |base
  Instructions:                                     369369|369418               (-0.01326%) [-1.00013x]
  ## pid: 5737 thread: 1 part: 2                          |pid: 5659 thread: 1 part: 2
  Command:
                                      /home/runner/work/_temp/gungraun-bin/head/gungraun|/home/runner/work/_temp/gungraun-bin/base/gungraun --gungraun-run d:d:000000 00006 00000 00000
  Instructions:                                     158362|158362               (No change)
  ## Total
  Instructions:                                     527731|527780               (-0.00928%) [-1.00009x]
gungraun::type_strip::bench_type_strip effect_schema_ast:(EFFECT_SCHEMA_AST, type_strip_options(Lang :: Ts)...
  ## pid: 5738 thread: 1 part: 1                          |pid: 5660 thread: 1 part: 1
  Command:
                                      /home/runner/work/_temp/gungraun-bin/head/gungraun|/home/runner/work/_temp/gungraun-bin/base/gungraun --gungraun-run d:d:000000 00006 00000 00001
  Baselines:                                              |base
  Instructions:                                    2985944|2985998              (-0.00181%) [-1.00002x]
  ## pid: 5738 thread: 1 part: 2                          |pid: 5660 thread: 1 part: 2
  Command:
                                      /home/runner/work/_temp/gungraun-bin/head/gungraun|/home/runner/work/_temp/gungraun-bin/base/gungraun --gungraun-run d:d:000000 00006 00000 00001
  Instructions:                                     675715|675715               (No change)
  ## Total
  Instructions:                                    3661659|3661713              (-0.00147%) [-1.00001x]
gungraun::type_strip::bench_type_strip hono_types:(HONO_TYPES, type_strip_options(Lang :: Ts))
  ## pid: 5739 thread: 1 part: 1                          |pid: 5662 thread: 1 part: 1
  Command:
                                      /home/runner/work/_temp/gungraun-bin/head/gungraun|/home/runner/work/_temp/gungraun-bin/base/gungraun --gungraun-run d:d:000000 00006 00000 00002
  Baselines:                                              |base
  Instructions:                                    2891256|2891267              (-0.00038%) [-1.00000x]
  ## pid: 5739 thread: 1 part: 2                          |pid: 5662 thread: 1 part: 2
  Command:
                                      /home/runner/work/_temp/gungraun-bin/head/gungraun|/home/runner/work/_temp/gungraun-bin/base/gungraun --gungraun-run d:d:000000 00006 00000 00002
  Instructions:                                     112005|112005               (No change)
  ## Total
  Instructions:                                    3003261|3003272              (-0.00037%) [-1.00000x]
gungraun::visit::bench_visit typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   25119209|25119209             (No change)
gungraun::visit::bench_visit cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                                              |base
  Instructions:                                    2874310|2874310              (No change)
gungraun::visit::bench_visit_mut typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   24288597|24288597             (No change)
gungraun::visit::bench_visit_mut cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                                              |base
  Instructions:                                    2555855|2555855              (No change)
gungraun::visit::bench_traverse typescript:(setup_program(TYPESCRIPT, Lang :: Js))
  Baselines:                                              |base
  Instructions:                                   25822582|25822582             (No change)
gungraun::visit::bench_traverse cal_com_tsx:(setup_program(CAL_COM_TSX, Lang :: Tsx))
  Baselines:                                              |base
  Instructions:                                    2826624|2826624              (No change)

Gungraun result: Ok. 59 without regressions; 0 regressed; 0 filtered; 59 benchmarks finished in 57.2558s

@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

JavaScript API Gungraun benchmark diff

Base: f6f4151d645e55d9271991b0fbfc87f940ed3197; compare: 977d2b2bd8210950e185d8cb9c28b35c74908a01

Values are shown as compare / base.

Download the raw Gungraun and Valgrind data (retained for 90 days).

Callgrind metric changes

Median instruction counts from three processes, shown as compare / base in K (1,000), truncated to whole thousands. Percentages are rounded to at most three decimal places. Lower is better: 🟢 improvement, 🔴 regression, ⚪ unchanged or overlapping ranges (inconclusive).

JIT disabled (--jitless); predictable mode enabled (--predictable). Counts are not wall time. Exact counts, ranges and profiles are retained in artifacts.

Generate
Benchmark Ir (K) Change
underscore_1_5_2_js 416,797 / 416,797 0% ⚪
Lang
Benchmark Ir (K) Change
tsx 26,891 / 26,891 0% ⚪
Parse
Benchmark Ir (K) Change
underscore_1_5_2_js 546,426 / 546,426 0% ⚪
Source type
Benchmark Ir (K) Change
mjs 26,591 / 26,591 0% ⚪
Walk
Benchmark Ir (K) Change
underscore_1_5_2_js 338,758 / 338,758 0% ⚪
Benchmark results

Exact instruction counts: median (min–max).

Benchmark Compare Ir Base Ir Assessment
generate/underscore_1_5_2_js 416797967 (416797967–416797967) 416797967 (416797967–416797967) Inconclusive (ranges overlap)
lang/tsx 26891662 (26891662–26891662) 26891662 (26891662–26891662) Inconclusive (ranges overlap)
parse/underscore_1_5_2_js 546426452 (546426444–546426463) 546426502 (546426408–546426506) Inconclusive (ranges overlap)
source_type/mjs 26591662 (26591662–26591662) 26591662 (26591662–26591662) Inconclusive (ranges overlap)
walk/underscore_1_5_2_js 338758647 (338758647–338758647) 338758647 (338758647–338758647) Inconclusive (ranges overlap)

Tuples were scanned twice to find conditional types with union checks,
even when no separator needed conditional indentation.

Detect those checks while formatting each member. When a separator needs
indentIfBreak, insert its measurement group before the first member so
the printer can resolve the group before it reaches the separator.
Tuple formatting can discover a measurement group after writing earlier
members. Keeping a content marker across Writer calls required the tuple
formatter to track where the marker was valid.

Let write_with_optional_prefix own that position. Write the opening line
before entering the scope and prepend measurement groups only when a
later tuple member needs conditional indentation.
@magic-akari
magic-akari marked this pull request as ready for review December 4, 2026 14:46
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-12-04T14:46:25.280689Z
We couldn’t complete this review. Comment @codex review to try again.
c15b044 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.

This branch has not been deployed

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant