Skip to content

fix: preserve ANTLR ATN data in rolldown build#738

Merged
lcottercertinia merged 1 commit intocertinia:mainfrom
lukecotter:bug-go-to-code-error
Mar 9, 2026
Merged

fix: preserve ANTLR ATN data in rolldown build#738
lcottercertinia merged 1 commit intocertinia:mainfrom
lukecotter:bug-go-to-code-error

Conversation

@lukecotter
Copy link
Contributor

Summary

  • Fix "Go to Source" crash (IllegalStateException: undefined) when extension is built with rolldown
  • Root cause: oxc printer replaces lone surrogates (0xD800-0xDFFF) with U+FFFD in long CJS strings, corrupting ANTLR's serialized ATN data (oxc#3526)
  • Add preserveAntlrATN transform plugin that converts ATN string literals to String.fromCharCode() arrays before the oxc printer processes them
  • Fix missing resolve.alias for apex-log-parser and align SWC minify options in rolldown config

Test plan

  • pnpm build:dev:fast — rolldown dev build succeeds
  • pnpm build:fast — rolldown production build succeeds
  • pnpm test — 720/720 tests pass
  • Launch extension (F5) → open debug log → "Go to Source" on Apex method → navigates without error

@lukecotter lukecotter force-pushed the bug-go-to-code-error branch from 4d1adb5 to 32cb61d Compare March 9, 2026 09:13
The oxc printer replaces lone surrogates (0xD800-0xDFFF) with U+FFFD in
long CJS strings, corrupting ANTLR's serialized ATN data and crashing
the "Go to Source" feature with IllegalStateException.

Add a preserveAntlrATN transform plugin that converts ATN string
literals to String.fromCharCode() arrays before the oxc printer
processes them, since numeric values are immune to re-serialization bugs.

Also fix rolldown lana config: add missing resolve.alias for
apex-log-parser, add keepNames to output, and align SWC minify options
with rollup config.

Upstream: oxc-project/oxc#3526

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lukecotter lukecotter force-pushed the bug-go-to-code-error branch from 32cb61d to 7a0c41d Compare March 9, 2026 09:15
@lcottercertinia lcottercertinia merged commit 4ecaa95 into certinia:main Mar 9, 2026
5 checks passed
@lukecotter lukecotter deleted the bug-go-to-code-error branch March 9, 2026 09:28
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.

2 participants