-
-
Notifications
You must be signed in to change notification settings - Fork 726
feat(oxc_codegen): support configure initial indent when using oxc_codegen
#13091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(oxc_codegen): support configure initial indent when using oxc_codegen
#13091
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
oxc_codegenoxc_codegen
oxc_codegenoxc_codegen
Merge activity
|
6a64976 to
e046e67
Compare
CodSpeed Instrumentation Performance ReportMerging #13091 will not alter performanceComparing Summary
Footnotes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for configuring the initial indentation level when using the oxc_codegen library. The feature allows users to specify a starting indentation depth for generated code, which is useful when the generated code needs to be embedded within already-indented contexts.
- Added
initial_indentfield toCodegenOptionsstruct - Updated default implementations to set initial indentation to 0
- Modified the codegen build process to apply the initial indentation setting
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/oxc_codegen/src/options.rs | Adds initial_indent field to CodegenOptions and updates default implementations |
| crates/oxc_codegen/src/lib.rs | Applies the initial indentation setting during codegen build process |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
e046e67 to
60ec5e6
Compare
…odegen` (#13091) Here is an example in rolldown https://github.com/rolldown/rolldown/pull/5724/files#diff-8a1733ecebbc28acb7d0c6ccd52499d7d2c9611f046b0b4a30ee3e1f939cbf13R57-R74, when concate multiple module, rolldown uses the output of `oxc_codegen` for AST and adding head and tail of the concatenatedModules with string replace to make sure generates the correct sourcemap with minimum effort. In this scenario, rolldown needs `oxc_codegen` to start generating string with initial ident `1`
a8ec1fd to
39631b5
Compare
…odegen` (#13091) Here is an example in rolldown https://github.com/rolldown/rolldown/pull/5724/files#diff-8a1733ecebbc28acb7d0c6ccd52499d7d2c9611f046b0b4a30ee3e1f939cbf13R57-R74, when concate multiple module, rolldown uses the output of `oxc_codegen` for AST and adding head and tail of the concatenatedModules with string replace to make sure generates the correct sourcemap with minimum effort. In this scenario, rolldown needs `oxc_codegen` to start generating string with initial ident `1`
39631b5 to
df3829c
Compare
|
Why is this merged without review? |
|
It seems like you submitted the PR with auto-merge enabled.
|
I am sorry, rolldown has a merge rule that merging only happens after at least one approval. |
|
Feel free to revert it if it has any issues. |

Here is an example in rolldown https://github.com/rolldown/rolldown/pull/5724/files#diff-8a1733ecebbc28acb7d0c6ccd52499d7d2c9611f046b0b4a30ee3e1f939cbf13R57-R74, when concate multiple module, rolldown uses the output of
oxc_codegenfor AST and adding head and tail of the concatenatedModules with string replace to make sure generates the correct sourcemap with minimum effort.In this scenario, rolldown needs
oxc_codegento start generating string with initial ident1