Skip to content
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(es/codegen): ability to set indentation string via rust api #7494

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

dsherret
Copy link
Contributor

@dsherret dsherret commented Jun 5, 2023

Description:

This adds the ability to set the indentation string of JsWriter via the Rust API. The motivation behind this change is to allow people to use other indentation in the emit output like tabs or two spaces via the Rust API.

@@ -33,6 +34,7 @@ impl<'a, W: Write> JsWriter<'a, W> {
) -> Self {
JsWriter {
indent: Default::default(),
indent_str: " ",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this should be set in the constructor like new_line?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, nevermind. Let's use set_indent_str instead for now.

Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

swc-bump:

  • swc_ecma_codegen

@kdy1 kdy1 enabled auto-merge (squash) June 7, 2023 03:00
@kdy1 kdy1 merged commit a343e7c into swc-project:main Jun 7, 2023
126 of 128 checks passed
@kdy1 kdy1 modified the milestones: Planned, v1.3.63 Jun 7, 2023
@swc-project swc-project locked as resolved and limited conversation to collaborators Jul 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants