Conversation
|
WalkthroughThis PR updates the HTML formatter's element list configuration approach. The public API method Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
crates/biome_html_formatter/tests/specs/html/svelte/issue_8515.svelte.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (11)
crates/biome_html_formatter/src/html/lists/element_list.rs(1 hunks)crates/biome_html_formatter/src/svelte/auxiliary/await_catch_block.rs(1 hunks)crates/biome_html_formatter/src/svelte/auxiliary/await_opening_block.rs(1 hunks)crates/biome_html_formatter/src/svelte/auxiliary/await_then_block.rs(1 hunks)crates/biome_html_formatter/src/svelte/auxiliary/else_clause.rs(1 hunks)crates/biome_html_formatter/src/svelte/auxiliary/else_if_clause.rs(1 hunks)crates/biome_html_formatter/src/svelte/auxiliary/if_opening_block.rs(1 hunks)crates/biome_html_formatter/src/svelte/auxiliary/key_block.rs(1 hunks)crates/biome_html_formatter/src/svelte/auxiliary/snippet_opening_block.rs(1 hunks)crates/biome_html_formatter/tests/quick_test.rs(1 hunks)crates/biome_html_formatter/tests/specs/html/svelte/issue_8515.svelte(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use thedbg!()macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests
Files:
crates/biome_html_formatter/src/html/lists/element_list.rscrates/biome_html_formatter/src/svelte/auxiliary/if_opening_block.rscrates/biome_html_formatter/src/svelte/auxiliary/key_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_opening_block.rscrates/biome_html_formatter/src/svelte/auxiliary/snippet_opening_block.rscrates/biome_html_formatter/tests/quick_test.rscrates/biome_html_formatter/src/svelte/auxiliary/await_catch_block.rscrates/biome_html_formatter/src/svelte/auxiliary/else_if_clause.rscrates/biome_html_formatter/src/svelte/auxiliary/await_then_block.rscrates/biome_html_formatter/src/svelte/auxiliary/else_clause.rs
🧠 Learnings (28)
📓 Common learnings
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.782Z
Learning: For formatter changes in changesets, show formatting changes using diff code blocks
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Define `FormatHtmlSyntaxNode` struct in a `cst.rs` file implementing `FormatRule<HtmlSyntaxNode>`, `AsFormat<HtmlFormatContext>`, and `IntoFormat<HtmlFormatContext>` traits using the provided boilerplate code
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/if_opening_block.rscrates/biome_html_formatter/src/svelte/auxiliary/key_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_opening_block.rscrates/biome_html_formatter/src/svelte/auxiliary/snippet_opening_block.rscrates/biome_html_formatter/tests/quick_test.rscrates/biome_html_formatter/src/svelte/auxiliary/await_catch_block.rscrates/biome_html_formatter/src/svelte/auxiliary/else_if_clause.rscrates/biome_html_formatter/src/svelte/auxiliary/await_then_block.rscrates/biome_html_formatter/src/svelte/auxiliary/else_clause.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Implement the `FormatNodeRule<N>` trait with `fmt_fields` as the only required method; default implementations of `fmt`, `is_suppressed`, `fmt_leading_comments`, `fmt_dangling_comments`, and `fmt_trailing_comments` are provided
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/if_opening_block.rscrates/biome_html_formatter/src/svelte/auxiliary/key_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_opening_block.rscrates/biome_html_formatter/src/svelte/auxiliary/snippet_opening_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_catch_block.rscrates/biome_html_formatter/src/svelte/auxiliary/else_if_clause.rscrates/biome_html_formatter/src/svelte/auxiliary/await_then_block.rscrates/biome_html_formatter/src/svelte/auxiliary/else_clause.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/context.rs : Define `<Language>FormatContext` struct in a `context.rs` file containing `comments` and `source_map` fields, implementing `FormatContext` and `CstFormatContext` traits
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/key_block.rscrates/biome_html_formatter/src/svelte/auxiliary/snippet_opening_block.rscrates/biome_html_formatter/tests/quick_test.rscrates/biome_html_formatter/src/svelte/auxiliary/await_catch_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_then_block.rscrates/biome_html_formatter/src/svelte/auxiliary/else_clause.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `full_options` code block property for complete biome.json configuration snippets in documentation
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/key_block.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/key_block.rscrates/biome_html_formatter/src/svelte/auxiliary/snippet_opening_block.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Prefix line with `#` in documentation code examples sparingly; prefer concise complete snippets
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/key_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_opening_block.rscrates/biome_html_formatter/src/svelte/auxiliary/snippet_opening_block.rscrates/biome_html_formatter/tests/quick_test.rscrates/biome_html_formatter/src/svelte/auxiliary/await_catch_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_then_block.rscrates/biome_html_formatter/src/svelte/auxiliary/else_clause.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation code blocks should be ordered as language, expect_diagnostic, options/full_options/use_options, ignore, file
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/key_block.rscrates/biome_html_formatter/src/svelte/auxiliary/snippet_opening_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_catch_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_then_block.rscrates/biome_html_formatter/src/svelte/auxiliary/else_clause.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, use mandatory tokens from the AST instead of hardcoding token strings (e.g., use `node.l_paren_token().format()` instead of `token("(")`)
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/key_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_opening_block.rscrates/biome_html_formatter/src/svelte/auxiliary/snippet_opening_block.rscrates/biome_html_formatter/tests/quick_test.rscrates/biome_html_formatter/src/svelte/auxiliary/await_catch_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_then_block.rscrates/biome_html_formatter/src/svelte/auxiliary/else_clause.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/key_block.rscrates/biome_html_formatter/src/svelte/auxiliary/else_clause.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation code blocks must have a language defined for syntax highlighting
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/key_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_catch_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_then_block.rs
📚 Learning: 2025-12-21T21:15:03.782Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.782Z
Learning: For formatter changes in changesets, show formatting changes using diff code blocks
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/key_block.rscrates/biome_html_formatter/src/svelte/auxiliary/snippet_opening_block.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/lib.rs : Expose a public `format_node` function that accepts formatting options and a root syntax node, returning a `FormatResult<Formatted<Context>>` with appropriate documentation
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/key_block.rscrates/biome_html_formatter/src/svelte/auxiliary/snippet_opening_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_then_block.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import the `FormatNode` trait and implement it for your Node when creating formatters in biome_js_formatter
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/key_block.rscrates/biome_html_formatter/src/svelte/auxiliary/snippet_opening_block.rscrates/biome_html_formatter/tests/quick_test.rscrates/biome_html_formatter/src/svelte/auxiliary/await_catch_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_then_block.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Lines prefixed with `#` in rule documentation code examples will be hidden from output
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/snippet_opening_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_catch_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_then_block.rscrates/biome_html_formatter/src/svelte/auxiliary/else_clause.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code; if a token/node is known to be mandatory but is missing, return `None` instead
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/snippet_opening_block.rscrates/biome_html_formatter/src/svelte/auxiliary/await_then_block.rscrates/biome_html_formatter/src/svelte/auxiliary/else_clause.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/language.rs : Implement `TestFormatLanguage` trait in `tests/language.rs` for the formatter's test language
Applied to files:
crates/biome_html_formatter/tests/quick_test.rs
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.
Applied to files:
crates/biome_html_formatter/tests/quick_test.rscrates/biome_html_formatter/tests/specs/html/svelte/issue_8515.svelte
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/spec_tests.rs : Use the `tests_macros::gen_tests!` macro in `spec_tests.rs` to generate test functions for each specification file matching the pattern `tests/specs/<language>/**/*.<ext>`
Applied to files:
crates/biome_html_formatter/tests/quick_test.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/Cargo.toml : Include development dependencies in `Cargo.toml` for formatter tests: `biome_formatter_test`, `biome_<language>_factory`, `biome_<language>_parser`, `biome_parser`, `biome_service`, `countme`, `iai`, `quickcheck`, `quickcheck_macros`, and `tests_macros`
Applied to files:
crates/biome_html_formatter/tests/quick_test.rs
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Implement watcher tests for workspace methods in watcher.tests.rs and end-to-end tests in LSP tests
Applied to files:
crates/biome_html_formatter/tests/quick_test.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` instead of `Arc` for types that reference other types to avoid stale cache issues when modules are replaced
Applied to files:
crates/biome_html_formatter/tests/quick_test.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Assist rules should detect refactoring opportunities and emit code action signals
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/await_catch_block.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `version` field to `next` in `declare_lint_rule!` macro
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/await_catch_block.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `let else` trick when `run` function returns `Vec` to reduce code branching
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/else_if_clause.rscrates/biome_html_formatter/src/svelte/auxiliary/else_clause.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/comments.rs : Define `<Language>CommentStyle` as a public type alias for `Comments<<Language>Language>` in a `comments.rs` file
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/await_then_block.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use helper functions instead of hardcoding
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/else_clause.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : The first paragraph of rule documentation must be a single line describing what the rule does
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/else_clause.rs
🧬 Code graph analysis (1)
crates/biome_html_formatter/tests/quick_test.rs (1)
crates/biome_html_syntax/src/file_source.rs (1)
svelte(96-100)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: End-to-end tests
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Documentation
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test Node.js API
- GitHub Check: autofix
🔇 Additional comments (11)
crates/biome_html_formatter/tests/specs/html/svelte/issue_8515.svelte (1)
1-3: LGTM! Test fixture appropriately covers the reported issue.This minimal Svelte 5 snippet syntax test case validates the fix for issue #8515.
crates/biome_html_formatter/src/svelte/auxiliary/await_opening_block.rs (1)
44-46: LGTM! Formatting configuration updated consistently.The switch from group-based to explicit multiline formatting aligns with the broader refactoring across all Svelte auxiliary blocks.
crates/biome_html_formatter/tests/quick_test.rs (1)
23-30: LGTM! Test input updated to Svelte snippet syntax.Appropriately covers the Svelte 5 snippet formatting scenario.
crates/biome_html_formatter/src/svelte/auxiliary/if_opening_block.rs (1)
29-31: LGTM! Consistent formatting change.Aligns with the multiline formatting refactoring across Svelte auxiliary blocks.
crates/biome_html_formatter/src/svelte/auxiliary/snippet_opening_block.rs (1)
33-35: LGTM! Core fix for snippet formatting.This change directly addresses the reported panic with Svelte 5
{#snippet}syntax.crates/biome_html_formatter/src/svelte/auxiliary/key_block.rs (1)
17-19: LGTM! Consistent with the refactoring pattern.crates/biome_html_formatter/src/html/lists/element_list.rs (1)
35-38: LGTM! Cleaner API for multiline formatting.The new
with_multiline()method provides a more direct way to configure multiline layout compared to the previous group-based approach.crates/biome_html_formatter/src/svelte/auxiliary/else_if_clause.rs (1)
32-34: LGTM! Completes the consistent refactoring.All Svelte auxiliary blocks now use the unified multiline formatting approach.
crates/biome_html_formatter/src/svelte/auxiliary/else_clause.rs (1)
25-26: Consistent formatter API update.The change mirrors the pattern across other Svelte auxiliary formatters and should contribute to fixing the
{#snippet}syntax issue.crates/biome_html_formatter/src/svelte/auxiliary/await_then_block.rs (1)
28-29: All Svelte auxiliary formatters successfully migrated towith_multiline().Verified that no remaining usages of
with_group_id()exist in the Svelte formatters. The change at lines 28-29 is correct and completes the migration.crates/biome_html_formatter/src/svelte/auxiliary/await_catch_block.rs (1)
29-30: Thewith_multiline()API is available and correctly used.The change from group-ID-based to multiline formatting is sound.
| let source_type = HtmlFileSource::html(); | ||
| let source_type = HtmlFileSource::svelte(); | ||
| let tree = parse_html(src, HtmlParseOptions::from(&source_type)); | ||
| let options = HtmlFormatOptions::new(HtmlFileSource::html()) |
There was a problem hiding this comment.
Inconsistent source type in formatting options.
Line 31 correctly uses HtmlFileSource::svelte() for parsing, but Line 33 uses HtmlFileSource::html() for format options. These should match to ensure consistent formatting behaviour.
🔎 Proposed fix
- let options = HtmlFormatOptions::new(HtmlFileSource::html())
+ let options = HtmlFormatOptions::new(source_type)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| let options = HtmlFormatOptions::new(HtmlFileSource::html()) | |
| let source_type = HtmlFileSource::svelte() | |
| let parsed = parse_html(input, source_type) | |
| let options = HtmlFormatOptions::new(source_type) |
🤖 Prompt for AI Agents
In crates/biome_html_formatter/tests/quick_test.rs around lines 31 to 33, the
HtmlFormatOptions is created with HtmlFileSource::html() while the parser uses
HtmlFileSource::svelte(); change the format options to use
HtmlFileSource::svelte() so the source type matches the parser (i.e., replace
HtmlFileSource::html() with HtmlFileSource::svelte()).
Summary
Closes #8515
Test Plan
Added a test
Docs