Skip to content

fix: handling of indent inside embedded language #718

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

Merged
merged 8 commits into from
Jun 12, 2025

Conversation

kt3k
Copy link
Contributor

@kt3k kt3k commented Jun 5, 2025

This PR fixes the handling of indent inside the template literals with embedded languages.

Currently the leading whitespaces in the line of embedded external languages are handled as part of source code, and that causes the issue denoland/deno#29164 . This PR fixes it by skipping the leading whitespaces, but instead adding StartIndent and FinishIndent IR signals based on current indent level of the embedded language.

related denoland/deno#29164

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

LGTM.

@dsherret dsherret merged commit 389e9a8 into dprint:main Jun 12, 2025
3 checks passed
@kt3k kt3k deleted the fix-indent-inside-embedded-lang branch June 13, 2025 01:05
kt3k added a commit to denoland/deno that referenced this pull request Jun 17, 2025
This commit fixes the handling of indent inside the template languages.

See dprint/dprint-plugin-typescript#718 for
details
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.

3 participants