From 3de03c1beda09c6c45e75e86e4bb20603c3082c1 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Fri, 16 Oct 2026 18:07:16 +0000 Subject: [PATCH] docs(packages/codegen): correct outdated comments (#27838) Comments-only change. Correct comments saying the printer does not support `ParenthesizedExpression`. This isn't true - it does! --- packages/codegen/test/print.test.ts | 8 +++++--- packages/codegen/test/source-maps.test.ts | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/codegen/test/print.test.ts b/packages/codegen/test/print.test.ts index 5a271f3268..3de75ddab7 100644 --- a/packages/codegen/test/print.test.ts +++ b/packages/codegen/test/print.test.ts @@ -19,9 +19,11 @@ import type * as ESTree from "../../../npm/oxc-types/types.d.ts"; // Parse options for the cases which give source rather than an AST. // -// `preserveParens: false` because this printer deliberately does not support the redundant -// `ParenthesizedExpression` node. `experimentalRawTransfer` is how the printer is meant to be used, -// so the ASTs are the shape it really sees. +// `preserveParens: false`, so every paren in the output is one the printer decided on itself. +// The printer does support `ParenthesizedExpression` nodes - hand-built ASTs below test them, +// and the fixture and conformance suites check both `preserveParens` modes against Rust. +// +// `experimentalRawTransfer` is how the printer is meant to be used, so the ASTs are the shape it really sees. // // `experimentalRawTransfer` is not in the published `ParserOptions` type - it is experimental and // untyped. Declaring the object here rather than inline at the call site keeps TypeScript's excess diff --git a/packages/codegen/test/source-maps.test.ts b/packages/codegen/test/source-maps.test.ts index bacde1b84e..3b97beac95 100644 --- a/packages/codegen/test/source-maps.test.ts +++ b/packages/codegen/test/source-maps.test.ts @@ -23,9 +23,11 @@ import type * as ESTree from "../../../npm/oxc-types/types.d.ts"; // The inline fixtures below always run. const CACHE_DIR_PATH = pathJoin(import.meta.dirname, "../../../target"); -// `preserveParens: false` because this printer deliberately does not support the redundant -// `ParenthesizedExpression` / `TSParenthesizedType` nodes. `experimentalRawTransfer` is how the -// printer is meant to be used, so the ASTs here are the shape it really sees. +// One `preserveParens` mode is enough for these checks, so `false`. The printer supports +// `ParenthesizedExpression` / `TSParenthesizedType` nodes, and the fixture and conformance suites +// check both modes against Rust. +// +// `experimentalRawTransfer` is how the printer is meant to be used, so the ASTs here are the shape it really sees. const PARSE_OPTIONS = { preserveParens: false, experimentalRawTransfer: true,