docs/plans/4520-code-block-format-highlight.md
Verify whether issue #4520 is still reproducible on current main, determine whether PR #4837 actually fixes it, and if not, land the smallest test-first fix.
#4520Code block formatting causing syntax highlight to be lost#4837 (fix(code-block): fix normalizer and insertBreak for syntax highlighting)#4837 targets different symptoms:
code_lineinsertBreak resetting decorations2026-03-26-code-block-language-change-must-trigger-redecorate.md says cache reset alone is insufficient; editor.api.redecorate() is required after decoration-invalidating changes.formatCodeBlock rewrote formatted JSON into a single code_line text node containing embedded \n, so decorate only had one structural line to target.packages/code-block/src/lib/formatter/formatter.tsformatCodeBlock to rebuild code_line children and call redecorate.setCodeBlockContent transform and removed the stale local redecorate cast.bun test for touched code-block specs.pnpm lint:fix.bun test packages/code-block/src/libpnpm installpnpm turbo build --filter=./packages/code-blockpnpm turbo typecheck --filter=./packages/code-blockpnpm lint:fixpnpm check