refactor(formatter): Split print/embed file#19699
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. |
There was a problem hiding this comment.
Pull request overview
This PR refactors the template formatting code by extracting embedded language formatting logic into a dedicated submodule. The change improves code organization by separating concerns: the main template/mod.rs handles general template formatting, while template/embed/mod.rs specializes in formatting embedded languages (CSS, GraphQL, HTML, Markdown, Angular templates) within template literals.
Changes:
- Extracted 8 functions related to embedded language formatting from
template/mod.rsto a newtemplate/embed/mod.rsmodule - Updated function calls in
template/mod.rsto use theembed::module prefix - Cleaned up imports by removing dependencies only needed by the embedded formatting logic
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/oxc_formatter/src/print/template/mod.rs | Removed embedded formatting functions, added embed submodule declaration, updated function calls to use embed:: prefix, cleaned up unused imports |
| crates/oxc_formatter/src/print/template/embed/mod.rs | New module containing all embedded language formatting logic (8 functions moved from parent module) |
Merging this PR will not alter performance
Comparing Footnotes
|
print/embed file
1dad873 to
fdbbab7
Compare
Merge activity
|
Simply extracted a portion of the file.
fdbbab7 to
06983a4
Compare

Simply extracted a portion of the file.