-
-
Notifications
You must be signed in to change notification settings - Fork 791
feat(html): implement {@debug} parsing
#7969
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
Conversation
🦋 Changeset detectedLatest commit: df44d16 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
{@debug} parsing
WalkthroughAdds Svelte {@debug} support end‑to‑end: grammar, lexer, parser and formatter. New tokens and grammar nodes were introduced (SVELTE_DEBUG_BLOCK, SVELTE_BINDING_LIST, SVELTE_NAME, SVELTE_BOGUS_BLOCK, SVELTE_IDENT, COMMA and sv_curly_* punctuators) and a HtmlLexContext::Svelte. The parser gains parse_svelte_at_block, parse_debug_block and a BindingList separated-list parser with recovery. The formatter adds FormatSvelte* implementations (debug block, name, binding list, bogus block, any‑block), separated‑list helpers, trivia helpers and tests for debug formatting. Small test and codegen updates accompany the changes. Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (2)**/*.{rs,toml}📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
**/*.rs📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
🧠 Learnings (12)📓 Common learnings📚 Learning: 2025-10-15T09:24:31.042ZApplied to files:
📚 Learning: 2025-10-15T09:22:46.002ZApplied to files:
📚 Learning: 2025-10-15T09:22:15.851ZApplied to files:
📚 Learning: 2025-10-15T09:22:15.851ZApplied to files:
📚 Learning: 2025-10-15T09:22:15.851ZApplied to files:
📚 Learning: 2025-10-15T09:22:15.851ZApplied to files:
📚 Learning: 2025-10-15T09:24:31.042ZApplied to files:
📚 Learning: 2025-10-15T09:22:46.002ZApplied to files:
📚 Learning: 2025-10-15T09:22:46.002ZApplied to files:
📚 Learning: 2025-10-15T09:22:15.851ZApplied to files:
📚 Learning: 2025-10-15T09:22:15.851ZApplied to files:
🧬 Code graph analysis (1)crates/biome_html_parser/src/lexer/mod.rs (2)
⏰ 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). (10)
🔇 Additional comments (8)
Comment |
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.
Actionable comments posted: 2
🧹 Nitpick comments (2)
crates/biome_html_parser/src/syntax/parse_error.rs (1)
96-98: Consider renaming for clarity.The function name
expected_svelte_closing_blocksuggests a missing closing brace, but the diagnostic message is "Expected an identifier." This mismatch may confuse future readers. Consider renaming toexpected_svelte_identifierto align with the message, or update the message to match the function's intent..changeset/nine-bottles-float.md (1)
5-5: Consider using "can now" instead of "is now able to".As a more concise alternative, you could write: "The Biome HTML parser can now parse and format the blocks".
Apply this diff to simplify the wording:
-Added support for the Svelte syntax `{@debug}`. The Biome HTML parser is now able to parse and format the blocks: +Added support for the Svelte syntax `{@debug}`. The Biome HTML parser can now parse and format the blocks:
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (10)
crates/biome_html_factory/src/generated/node_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_html_factory/src/generated/syntax_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_html_formatter/tests/specs/html/svelte/debug.svelte.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.svelte.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/error/svelte/debug.svelte.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/svelte/debug.svelte.snapis excluded by!**/*.snapand included by**crates/biome_html_syntax/src/generated/kind.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_html_syntax/src/generated/macros.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_html_syntax/src/generated/nodes.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_html_syntax/src/generated/nodes_mut.rsis excluded by!**/generated/**,!**/generated/**and included by**
📒 Files selected for processing (31)
.changeset/nine-bottles-float.md(1 hunks)crates/biome_html_formatter/src/generated.rs(4 hunks)crates/biome_html_formatter/src/html/any/text_expression.rs(1 hunks)crates/biome_html_formatter/src/lib.rs(1 hunks)crates/biome_html_formatter/src/separated.rs(1 hunks)crates/biome_html_formatter/src/svelte/any/block.rs(1 hunks)crates/biome_html_formatter/src/svelte/any/mod.rs(1 hunks)crates/biome_html_formatter/src/svelte/auxiliary/debug_block.rs(1 hunks)crates/biome_html_formatter/src/svelte/auxiliary/mod.rs(1 hunks)crates/biome_html_formatter/src/svelte/auxiliary/name.rs(1 hunks)crates/biome_html_formatter/src/svelte/bogus/bogus_block.rs(1 hunks)crates/biome_html_formatter/src/svelte/bogus/mod.rs(1 hunks)crates/biome_html_formatter/src/svelte/lists/binding_list.rs(1 hunks)crates/biome_html_formatter/src/svelte/lists/mod.rs(1 hunks)crates/biome_html_formatter/src/svelte/mod.rs(1 hunks)crates/biome_html_formatter/src/trivia.rs(2 hunks)crates/biome_html_formatter/tests/specs/html/svelte/debug.svelte(1 hunks)crates/biome_html_parser/src/lexer/mod.rs(19 hunks)crates/biome_html_parser/src/lexer/tests.rs(1 hunks)crates/biome_html_parser/src/syntax/mod.rs(3 hunks)crates/biome_html_parser/src/syntax/parse_error.rs(1 hunks)crates/biome_html_parser/src/syntax/svelte.rs(1 hunks)crates/biome_html_parser/src/token_source.rs(1 hunks)crates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.svelte(1 hunks)crates/biome_html_parser/tests/html_specs/error/svelte/debug.svelte(1 hunks)crates/biome_html_parser/tests/html_specs/ok/svelte/debug.svelte(1 hunks)crates/biome_html_parser/tests/spec_test.rs(1 hunks)xtask/codegen/html.ungram(3 hunks)xtask/codegen/src/generate_nodes.rs(1 hunks)xtask/codegen/src/html_kinds_src.rs(2 hunks)xtask/codegen/src/js_kinds_src.rs(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Format Rust and TOML files before committing (e.g., via
just f)
Files:
crates/biome_html_parser/src/syntax/parse_error.rscrates/biome_html_parser/src/token_source.rscrates/biome_html_formatter/src/lib.rscrates/biome_html_formatter/src/svelte/auxiliary/mod.rsxtask/codegen/src/js_kinds_src.rscrates/biome_html_parser/tests/spec_test.rscrates/biome_html_formatter/src/trivia.rscrates/biome_html_formatter/src/svelte/lists/binding_list.rscrates/biome_html_formatter/src/svelte/any/mod.rscrates/biome_html_formatter/src/svelte/auxiliary/name.rscrates/biome_html_formatter/src/svelte/mod.rscrates/biome_html_formatter/src/html/any/text_expression.rsxtask/codegen/src/html_kinds_src.rscrates/biome_html_formatter/src/svelte/lists/mod.rscrates/biome_html_formatter/src/svelte/bogus/mod.rscrates/biome_html_formatter/src/svelte/auxiliary/debug_block.rscrates/biome_html_parser/src/syntax/mod.rsxtask/codegen/src/generate_nodes.rscrates/biome_html_parser/src/syntax/svelte.rscrates/biome_html_formatter/src/separated.rscrates/biome_html_parser/src/lexer/tests.rscrates/biome_html_formatter/src/svelte/any/block.rscrates/biome_html_parser/src/lexer/mod.rscrates/biome_html_formatter/src/generated.rscrates/biome_html_formatter/src/svelte/bogus/bogus_block.rs
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Document rules, assists, and their options with inline rustdoc in the Rust source
Files:
crates/biome_html_parser/src/syntax/parse_error.rscrates/biome_html_parser/src/token_source.rscrates/biome_html_formatter/src/lib.rscrates/biome_html_formatter/src/svelte/auxiliary/mod.rsxtask/codegen/src/js_kinds_src.rscrates/biome_html_parser/tests/spec_test.rscrates/biome_html_formatter/src/trivia.rscrates/biome_html_formatter/src/svelte/lists/binding_list.rscrates/biome_html_formatter/src/svelte/any/mod.rscrates/biome_html_formatter/src/svelte/auxiliary/name.rscrates/biome_html_formatter/src/svelte/mod.rscrates/biome_html_formatter/src/html/any/text_expression.rsxtask/codegen/src/html_kinds_src.rscrates/biome_html_formatter/src/svelte/lists/mod.rscrates/biome_html_formatter/src/svelte/bogus/mod.rscrates/biome_html_formatter/src/svelte/auxiliary/debug_block.rscrates/biome_html_parser/src/syntax/mod.rsxtask/codegen/src/generate_nodes.rscrates/biome_html_parser/src/syntax/svelte.rscrates/biome_html_formatter/src/separated.rscrates/biome_html_parser/src/lexer/tests.rscrates/biome_html_formatter/src/svelte/any/block.rscrates/biome_html_parser/src/lexer/mod.rscrates/biome_html_formatter/src/generated.rscrates/biome_html_formatter/src/svelte/bogus/bogus_block.rs
.changeset/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/*.md: In changeset files, only use #### or ##### headers
Changesets should describe user-facing changes; internal-only changes do not need changesets
Use past tense for what you did in the changeset description and present tense for current behavior
For bug fixes, start the changeset description with a link to the issue (e.g., Fixed #1234: ...)
When referencing a rule or assist in a changeset, include a link to the rule/assist page on the website
Include a code block in the changeset when applicable to illustrate the change
End every sentence in a changeset with a full stop (.)
Files:
.changeset/nine-bottles-float.md
🧠 Learnings (53)
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : In ### Invalid doc examples, each snippet must use the expect_diagnostic modifier and emit exactly one diagnostic
Applied to files:
crates/biome_html_parser/src/syntax/parse_error.rscrates/biome_html_parser/tests/html_specs/error/svelte/debug.sveltecrates/biome_html_parser/tests/html_specs/ok/svelte/debug.sveltecrates/biome_html_formatter/tests/specs/html/svelte/debug.sveltecrates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.svelte
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Nodes for enclosing syntax errors must include the Bogus word (e.g., HtmlBogusAttribute)
Applied to files:
crates/biome_html_parser/src/syntax/parse_error.rsxtask/codegen/src/html_kinds_src.rscrates/biome_html_formatter/src/svelte/bogus/mod.rscrates/biome_html_parser/src/syntax/mod.rsxtask/codegen/html.ungramcrates/biome_html_parser/src/lexer/mod.rscrates/biome_html_formatter/src/svelte/bogus/bogus_block.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Implement FormatLanguage for HtmlFormatLanguage with associated types: SyntaxLanguage=HtmlLanguage, Context=HtmlFormatContext, FormatRule=FormatHtmlSyntaxNode
Applied to files:
crates/biome_html_parser/src/syntax/parse_error.rscrates/biome_html_parser/src/token_source.rscrates/biome_html_formatter/src/lib.rsxtask/codegen/src/js_kinds_src.rscrates/biome_html_parser/tests/spec_test.rscrates/biome_html_formatter/src/trivia.rscrates/biome_html_formatter/src/svelte/lists/binding_list.rscrates/biome_html_formatter/src/svelte/auxiliary/name.rscrates/biome_html_formatter/src/html/any/text_expression.rscrates/biome_html_formatter/src/svelte/auxiliary/debug_block.rscrates/biome_html_parser/src/syntax/mod.rscrates/biome_html_parser/src/syntax/svelte.rscrates/biome_html_formatter/src/separated.rscrates/biome_html_formatter/src/svelte/any/block.rscrates/biome_html_parser/src/lexer/mod.rscrates/biome_html_formatter/src/generated.rscrates/biome_html_formatter/src/svelte/bogus/bogus_block.rs
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : Every code block in docs must declare a language
Applied to files:
crates/biome_html_parser/src/syntax/parse_error.rscrates/biome_html_formatter/src/svelte/auxiliary/mod.rscrates/biome_html_formatter/src/svelte/any/mod.rscrates/biome_html_parser/src/syntax/mod.rscrates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.sveltecrates/biome_html_parser/src/lexer/tests.rs
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : Provide informative diagnostics: explain what the error is, why it triggers, and what to do (prefer a code action or a note)
Applied to files:
crates/biome_html_parser/src/syntax/parse_error.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to fix code; if a mandatory token/node is missing, return `None` instead
Applied to files:
crates/biome_html_parser/src/syntax/parse_error.rscrates/biome_html_formatter/src/trivia.rscrates/biome_html_formatter/src/svelte/any/mod.rscrates/biome_html_formatter/src/svelte/bogus/mod.rscrates/biome_html_parser/src/syntax/mod.rsxtask/codegen/src/generate_nodes.rscrates/biome_html_formatter/src/svelte/any/block.rscrates/biome_html_parser/src/lexer/mod.rscrates/biome_html_formatter/src/svelte/bogus/bogus_block.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Add a new LanguageKind variant (e.g., Html) in language_kind.rs and implement/cover all methods
Applied to files:
crates/biome_html_parser/src/token_source.rsxtask/codegen/src/js_kinds_src.rsxtask/codegen/src/html_kinds_src.rscrates/biome_html_parser/src/lexer/tests.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/context.rs : Create HtmlFormatContext in context.rs with comments and source_map fields and implement FormatContext and CstFormatContext
Applied to files:
crates/biome_html_parser/src/token_source.rscrates/biome_html_formatter/src/lib.rscrates/biome_html_formatter/src/trivia.rscrates/biome_html_formatter/src/svelte/lists/binding_list.rscrates/biome_html_formatter/src/svelte/auxiliary/name.rscrates/biome_html_formatter/src/html/any/text_expression.rscrates/biome_html_formatter/src/svelte/auxiliary/debug_block.rscrates/biome_html_formatter/src/separated.rscrates/biome_html_formatter/src/svelte/any/block.rscrates/biome_html_parser/src/lexer/mod.rscrates/biome_html_formatter/src/generated.rscrates/biome_html_formatter/src/svelte/bogus/bogus_block.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For non-mandatory tokens, use the provided helper constructors (e.g., `token`, `space_token`, `dynamic_token`)
Applied to files:
crates/biome_html_parser/src/token_source.rsxtask/codegen/src/js_kinds_src.rscrates/biome_html_formatter/src/trivia.rsxtask/codegen/src/html_kinds_src.rsxtask/codegen/src/generate_nodes.rscrates/biome_html_parser/src/lexer/tests.rscrates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/**/src/lexer/mod.rs : Create a lexer module at crates/<parser_crate>/src/lexer/mod.rs
Applied to files:
crates/biome_html_parser/src/token_source.rscrates/biome_html_formatter/src/lib.rscrates/biome_html_formatter/src/svelte/auxiliary/mod.rscrates/biome_html_formatter/src/svelte/any/mod.rscrates/biome_html_formatter/src/svelte/mod.rscrates/biome_html_formatter/src/svelte/lists/mod.rscrates/biome_html_formatter/src/svelte/bogus/mod.rscrates/biome_html_parser/src/syntax/mod.rscrates/biome_html_parser/src/syntax/svelte.rscrates/biome_html_parser/src/lexer/tests.rscrates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When a token is mandatory and present in the AST, use the AST-provided token (e.g., `node.l_paren_token().format()`) instead of emitting a static token
Applied to files:
crates/biome_html_parser/src/token_source.rsxtask/codegen/src/js_kinds_src.rscrates/biome_html_formatter/src/trivia.rscrates/biome_html_formatter/src/svelte/lists/binding_list.rsxtask/codegen/src/html_kinds_src.rscrates/biome_html_formatter/src/svelte/auxiliary/debug_block.rscrates/biome_html_parser/src/syntax/mod.rsxtask/codegen/src/generate_nodes.rscrates/biome_html_formatter/src/separated.rscrates/biome_html_parser/src/lexer/mod.rscrates/biome_html_formatter/src/generated.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/comments.rs : Expose a public HtmlComments type alias: `pub type HtmlComments = Comments<HtmlLanguage>;`
Applied to files:
crates/biome_html_parser/src/token_source.rscrates/biome_html_formatter/src/lib.rsxtask/codegen/src/js_kinds_src.rscrates/biome_html_formatter/src/trivia.rscrates/biome_html_formatter/src/separated.rscrates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/**/*.rs : After generation, remove usages of `format_verbatim_node` and implement real formatting with biome_formatter utilities
Applied to files:
crates/biome_html_formatter/src/lib.rscrates/biome_html_formatter/src/svelte/auxiliary/mod.rscrates/biome_html_parser/tests/spec_test.rscrates/biome_html_formatter/src/trivia.rscrates/biome_html_formatter/src/svelte/lists/binding_list.rscrates/biome_html_formatter/src/svelte/any/mod.rscrates/biome_html_formatter/src/svelte/auxiliary/name.rscrates/biome_html_formatter/src/svelte/mod.rscrates/biome_html_formatter/src/html/any/text_expression.rscrates/biome_html_formatter/src/svelte/lists/mod.rscrates/biome_html_formatter/src/svelte/bogus/mod.rscrates/biome_html_formatter/src/svelte/auxiliary/debug_block.rscrates/biome_html_parser/src/syntax/mod.rscrates/biome_html_formatter/src/separated.rscrates/biome_html_formatter/src/svelte/any/block.rscrates/biome_html_formatter/src/generated.rscrates/biome_html_formatter/src/svelte/bogus/bogus_block.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import and use the `FormatNode` trait for AST nodes
Applied to files:
crates/biome_html_formatter/src/lib.rscrates/biome_html_parser/tests/spec_test.rscrates/biome_html_formatter/src/trivia.rscrates/biome_html_formatter/src/svelte/lists/binding_list.rscrates/biome_html_formatter/src/svelte/auxiliary/name.rscrates/biome_html_formatter/src/html/any/text_expression.rscrates/biome_html_formatter/src/svelte/auxiliary/debug_block.rscrates/biome_html_parser/src/syntax/mod.rscrates/biome_html_formatter/src/separated.rscrates/biome_html_formatter/src/svelte/any/block.rscrates/biome_html_formatter/src/generated.rscrates/biome_html_formatter/src/svelte/bogus/bogus_block.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Define the HtmlFormatter type alias: `type HtmlFormatter<'buf> = Formatter<'buf, HtmlFormatContext>;`
Applied to files:
crates/biome_html_formatter/src/lib.rscrates/biome_html_formatter/src/trivia.rscrates/biome_html_formatter/src/svelte/lists/binding_list.rscrates/biome_html_formatter/src/svelte/auxiliary/name.rscrates/biome_html_formatter/src/html/any/text_expression.rscrates/biome_html_formatter/src/svelte/auxiliary/debug_block.rscrates/biome_html_formatter/src/separated.rscrates/biome_html_formatter/src/svelte/any/block.rscrates/biome_html_formatter/src/generated.rscrates/biome_html_formatter/src/svelte/bogus/bogus_block.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/cst.rs : Create FormatHtmlSyntaxNode in cst.rs implementing FormatRule<HtmlSyntaxNode> and AsFormat/IntoFormat for HtmlSyntaxNode using the provided plumbing
Applied to files:
crates/biome_html_formatter/src/lib.rsxtask/codegen/src/js_kinds_src.rscrates/biome_html_parser/tests/spec_test.rscrates/biome_html_formatter/src/trivia.rscrates/biome_html_formatter/src/svelte/lists/binding_list.rscrates/biome_html_formatter/src/svelte/auxiliary/name.rscrates/biome_html_formatter/src/html/any/text_expression.rscrates/biome_html_formatter/src/svelte/auxiliary/debug_block.rscrates/biome_html_parser/src/syntax/mod.rscrates/biome_html_formatter/src/separated.rscrates/biome_html_formatter/src/svelte/any/block.rscrates/biome_html_parser/src/lexer/mod.rscrates/biome_html_formatter/src/generated.rscrates/biome_html_formatter/src/svelte/bogus/bogus_block.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Add the provided AsFormat, IntoFormat, and iterator plumbing code to lib.rs
Applied to files:
crates/biome_html_formatter/src/lib.rscrates/biome_html_formatter/src/svelte/auxiliary/mod.rscrates/biome_html_formatter/src/svelte/lists/binding_list.rscrates/biome_html_formatter/src/svelte/auxiliary/name.rscrates/biome_html_formatter/src/svelte/mod.rscrates/biome_html_formatter/src/svelte/lists/mod.rscrates/biome_html_formatter/src/svelte/any/block.rscrates/biome_html_formatter/src/generated.rscrates/biome_html_formatter/src/svelte/bogus/bogus_block.rs
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Place per-rule options types in biome_rule_options crate under lib/, one file per rule
Applied to files:
crates/biome_html_formatter/src/lib.rscrates/biome_html_formatter/src/svelte/auxiliary/mod.rscrates/biome_html_formatter/src/svelte/any/mod.rscrates/biome_html_formatter/src/svelte/mod.rscrates/biome_html_formatter/src/svelte/lists/mod.rscrates/biome_html_formatter/src/separated.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Expose a documented public function `format_node(options: HtmlFormatOptions, root: &HtmlSyntaxNode) -> FormatResult<Formatted<HtmlFormatContext>>` delegating to `biome_formatter::format_node`
Applied to files:
crates/biome_html_formatter/src/lib.rscrates/biome_html_formatter/src/trivia.rscrates/biome_html_formatter/src/svelte/lists/binding_list.rscrates/biome_html_formatter/src/svelte/auxiliary/name.rscrates/biome_html_formatter/src/html/any/text_expression.rscrates/biome_html_formatter/src/svelte/auxiliary/debug_block.rscrates/biome_html_formatter/src/separated.rscrates/biome_html_formatter/src/svelte/any/block.rscrates/biome_html_formatter/src/generated.rscrates/biome_html_formatter/src/svelte/bogus/bogus_block.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Implement the `Format` trait for your node type and use `JsFormatter` with `write!`/`format_args!` to define formatting
Applied to files:
crates/biome_html_formatter/src/lib.rscrates/biome_html_formatter/src/trivia.rscrates/biome_html_formatter/src/svelte/lists/binding_list.rscrates/biome_html_formatter/src/svelte/auxiliary/name.rscrates/biome_html_formatter/src/html/any/text_expression.rscrates/biome_html_formatter/src/svelte/auxiliary/debug_block.rscrates/biome_html_formatter/src/separated.rscrates/biome_html_formatter/src/svelte/any/block.rscrates/biome_html_formatter/src/generated.rscrates/biome_html_formatter/src/svelte/bogus/bogus_block.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Create tests/language.rs defining `HtmlTestFormatLanguage` and implement the TestFormatLanguage trait
Applied to files:
crates/biome_html_formatter/src/lib.rsxtask/codegen/src/js_kinds_src.rscrates/biome_html_parser/tests/spec_test.rscrates/biome_html_formatter/src/trivia.rscrates/biome_html_formatter/src/svelte/lists/binding_list.rscrates/biome_html_formatter/src/svelte/auxiliary/name.rscrates/biome_html_formatter/src/html/any/text_expression.rscrates/biome_html_parser/tests/html_specs/error/svelte/debug.sveltecrates/biome_html_parser/src/syntax/mod.rscrates/biome_html_parser/tests/html_specs/ok/svelte/debug.sveltecrates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.sveltecrates/biome_html_formatter/src/separated.rscrates/biome_html_parser/src/lexer/tests.rscrates/biome_html_formatter/src/svelte/any/block.rscrates/biome_html_parser/src/lexer/mod.rscrates/biome_html_formatter/src/generated.rscrates/biome_html_formatter/src/svelte/bogus/bogus_block.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Run `just gen-formatter` to generate initial formatting code and then replace `format_verbatim_node` with proper IR-based formatting
Applied to files:
crates/biome_html_formatter/src/lib.rs
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/biome_module_graph/src/**/*.rs : Do not copy or clone data between module graph entries (including behind Arc). Each module must avoid holding duplicated data from another module to enable simple invalidation.
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/mod.rscrates/biome_html_formatter/src/svelte/any/mod.rscrates/biome_html_formatter/src/svelte/mod.rscrates/biome_html_formatter/src/svelte/lists/mod.rscrates/biome_html_formatter/src/svelte/bogus/mod.rscrates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/biome_*_{syntax,factory}/src/generated/** : Each new biome_<lang>_{syntax,factory} crate must have a src/generated/ directory for codegen output
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/mod.rscrates/biome_html_formatter/src/svelte/any/mod.rscrates/biome_html_formatter/src/svelte/mod.rscrates/biome_html_formatter/src/svelte/lists/mod.rscrates/biome_html_formatter/src/svelte/bogus/mod.rs
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : Use options/full_options/use_options code block modifiers as specified to demonstrate configuration in docs; keep modifier order consistent
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/mod.rscrates/biome_html_formatter/src/svelte/any/mod.rscrates/biome_html_formatter/src/svelte/mod.rscrates/biome_html_parser/src/syntax/mod.rscrates/biome_html_parser/tests/html_specs/ok/svelte/debug.sveltecrates/biome_html_formatter/tests/specs/html/svelte/debug.svelte
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Use `dbg_write!` to debug and inspect the emitted IR during formatting
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/mod.rscrates/biome_html_parser/tests/html_specs/error/svelte/debug.sveltecrates/biome_html_formatter/src/svelte/auxiliary/debug_block.rscrates/biome_html_parser/tests/html_specs/ok/svelte/debug.sveltecrates/biome_html_formatter/tests/specs/html/svelte/debug.svelte.changeset/nine-bottles-float.md
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/src/{type_info,local_inference,resolver,flattening}.rs : Avoid recursive type structures and cross-module Arcs; represent links between types using TypeReference and TypeData::Reference.
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/mod.rscrates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/src/*_kinds_src.rs : Add src/<lang>_kinds_src.rs under xtask/codegen that returns a static KindSrc
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/mod.rsxtask/codegen/src/html_kinds_src.rscrates/biome_html_formatter/src/svelte/lists/mod.rscrates/biome_html_formatter/src/svelte/bogus/mod.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Add a new language prefix (e.g., html_) to LANGUAGE_PREFIXES in language_kind.rs
Applied to files:
xtask/codegen/src/js_kinds_src.rsxtask/codegen/src/html_kinds_src.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/spec_tests.rs : In tests/spec_tests.rs, generate tests with `tests_macros::gen_tests! {"tests/specs/html/**/*.html", crate::spec_test::run, ""}`
Applied to files:
crates/biome_html_parser/tests/spec_test.rscrates/biome_html_formatter/src/svelte/mod.rscrates/biome_html_parser/tests/html_specs/error/svelte/debug.sveltecrates/biome_html_formatter/src/svelte/bogus/mod.rscrates/biome_html_parser/tests/html_specs/ok/svelte/debug.sveltecrates/biome_html_formatter/tests/specs/html/svelte/debug.sveltecrates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.sveltecrates/biome_html_parser/src/lexer/tests.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/specs/html/**/*.html : Place HTML test cases under tests/specs/html as .html files discovered by the test macro
Applied to files:
crates/biome_html_parser/tests/spec_test.rscrates/biome_html_parser/tests/html_specs/error/svelte/debug.sveltecrates/biome_html_parser/tests/html_specs/ok/svelte/debug.sveltecrates/biome_html_formatter/tests/specs/html/svelte/debug.sveltecrates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.sveltecrates/biome_html_parser/src/lexer/tests.rs
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/tests/quick_test.rs : Quick test lives in biome_js_analyze/tests/quick_test.rs; unignore #[ignore] and set rule filter and SOURCE for ad-hoc runs
Applied to files:
crates/biome_html_parser/tests/spec_test.rscrates/biome_html_parser/tests/html_specs/error/svelte/debug.sveltecrates/biome_html_parser/tests/html_specs/ok/svelte/debug.sveltecrates/biome_html_formatter/tests/specs/html/svelte/debug.sveltecrates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.svelte
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in ../biome_lsp/src/server.tests.rs
Applied to files:
crates/biome_html_parser/tests/spec_test.rscrates/biome_html_parser/tests/html_specs/error/svelte/debug.sveltecrates/biome_html_parser/tests/html_specs/ok/svelte/debug.sveltecrates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.sveltecrates/biome_html_parser/src/lexer/tests.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/spec_test.rs : Implement a `run` function in tests/spec_test.rs that wires SpecSnapshot and includes!("language.rs") as shown
Applied to files:
crates/biome_html_parser/tests/spec_test.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/** : Create a tests directory containing a specs subfolder and the files spec_test.rs, spec_tests.rs, and language.rs
Applied to files:
crates/biome_html_parser/tests/spec_test.rscrates/biome_html_parser/tests/html_specs/error/svelte/debug.sveltecrates/biome_html_parser/tests/html_specs/ok/svelte/debug.sveltecrates/biome_html_formatter/tests/specs/html/svelte/debug.sveltecrates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.sveltecrates/biome_html_parser/src/lexer/tests.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Place watcher tests related to workspace methods in src/workspace/watcher.tests.rs
Applied to files:
crates/biome_html_parser/tests/spec_test.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/biome_*_{syntax,factory}/** : Create per-language crates biome_<lang>_syntax and biome_<lang>_factory under crates/
Applied to files:
crates/biome_html_formatter/src/svelte/any/mod.rscrates/biome_html_formatter/src/svelte/mod.rscrates/biome_html_formatter/src/svelte/lists/mod.rscrates/biome_html_formatter/src/svelte/bogus/mod.rscrates/biome_html_parser/src/syntax/mod.rscrates/biome_html_parser/src/syntax/svelte.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/Cargo.toml : Declare the dependency `biome_js_formatter = { version = "0.0.1", path = "../biome_js_formatter" }` for internal installation
Applied to files:
crates/biome_html_formatter/src/svelte/any/mod.rscrates/biome_html_formatter/src/svelte/mod.rscrates/biome_html_formatter/src/svelte/lists/mod.rscrates/biome_html_formatter/src/svelte/bogus/mod.rs
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Derive Serialize, Deserialize, and Deserializable for rule options; add #[serde(rename_all = "camelCase", deny_unknown_fields, default)]
Applied to files:
crates/biome_html_formatter/src/svelte/auxiliary/name.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Bogus nodes must be part of a variant/union (e.g., AnyHtmlAttribute includes HtmlBogusAttribute)
Applied to files:
crates/biome_html_formatter/src/svelte/mod.rscrates/biome_html_formatter/src/html/any/text_expression.rsxtask/codegen/src/html_kinds_src.rscrates/biome_html_formatter/src/svelte/bogus/mod.rsxtask/codegen/html.ungramcrates/biome_html_formatter/src/svelte/any/block.rscrates/biome_html_formatter/src/svelte/bogus/bogus_block.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Unions of nodes must start with Any* (e.g., AnyHtmlAttribute)
Applied to files:
crates/biome_html_formatter/src/html/any/text_expression.rsxtask/codegen/html.ungram
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/tests/specs/**/*.jsonc : .jsonc snapshot test files must contain an array of code strings and are interpreted as script (no ESM import/export)
Applied to files:
crates/biome_html_parser/tests/html_specs/error/svelte/debug.sveltecrates/biome_html_parser/tests/html_specs/ok/svelte/debug.sveltecrates/biome_html_formatter/tests/specs/html/svelte/debug.sveltecrates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.svelte
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/tests/specs/**/{invalid*,valid*}.* : Name snapshot test files with invalid* and valid* prefixes to indicate reported vs non-reported cases
Applied to files:
crates/biome_html_parser/tests/html_specs/error/svelte/debug.sveltecrates/biome_html_formatter/tests/specs/html/svelte/debug.svelte
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Prefer Box<[Box<str>]> over Vec<String> for options string lists to reduce memory usage
Applied to files:
crates/biome_html_formatter/src/svelte/lists/mod.rs
📚 Learning: 2025-10-26T15:28:00.951Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-10-26T15:28:00.951Z
Learning: Applies to **/*.rs : Document rules, assists, and their options with inline rustdoc in the Rust source
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Lexer must implement the biome_parser::Lexer trait
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : All node names in grammar must start with the language prefix (e.g., HtmlSimpleAttribute)
Applied to files:
xtask/codegen/html.ungram
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Use conditional syntax (e.g., StrictMode.excluding_syntax) and wrap unsupported constructs into BOGUS nodes via or_invalid_to_bogus
Applied to files:
xtask/codegen/html.ungram
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : Avoid avoidable string allocations; compare against &str or TokenText rather than allocating Strings
Applied to files:
xtask/codegen/src/generate_nodes.rscrates/biome_html_parser/src/lexer/tests.rs
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : Rule documentation: first paragraph must be a single line summary
Applied to files:
crates/biome_html_formatter/tests/specs/html/svelte/debug.sveltecrates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.svelte
📚 Learning: 2025-10-26T15:28:00.951Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-10-26T15:28:00.951Z
Learning: Applies to .changeset/*.md : Include a code block in the changeset when applicable to illustrate the change
Applied to files:
.changeset/nine-bottles-float.md
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
Applied to files:
.changeset/nine-bottles-float.md
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/comments.rs : Define HtmlCommentStyle implementing CommentStyle in comments.rs
Applied to files:
crates/biome_html_parser/src/lexer/mod.rscrates/biome_html_formatter/src/generated.rs
🧬 Code graph analysis (14)
crates/biome_html_formatter/src/svelte/auxiliary/mod.rs (1)
crates/biome_html_syntax/src/generated/nodes.rs (4)
name(122-124)name(290-292)name(567-569)name(673-675)
crates/biome_html_parser/tests/spec_test.rs (3)
crates/biome_html_parser/src/lib.rs (1)
parse_html(37-40)packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
HtmlFileSource(9551-9553)crates/biome_html_syntax/src/file_source.rs (1)
svelte(96-100)
crates/biome_html_formatter/src/trivia.rs (5)
crates/biome_css_formatter/src/trivia.rs (2)
on_skipped(72-74)on_removed(76-78)crates/biome_js_formatter/src/trivia.rs (2)
on_skipped(72-74)on_removed(76-78)crates/biome_json_formatter/src/trivia.rs (2)
on_skipped(72-74)on_removed(76-78)crates/biome_graphql_formatter/src/graphql/auxiliary/union_member_types.rs (1)
on_skipped(46-48)crates/biome_grit_formatter/src/separated.rs (2)
on_skipped(13-15)on_removed(17-19)
crates/biome_html_formatter/src/svelte/lists/binding_list.rs (2)
crates/biome_html_formatter/src/lib.rs (1)
formatted(314-323)crates/biome_formatter/src/builders.rs (1)
space(606-608)
crates/biome_html_formatter/src/svelte/auxiliary/name.rs (3)
crates/biome_html_formatter/src/lib.rs (6)
fmt_fields(247-247)format(51-51)format(64-66)format(81-86)format(101-103)format(297-299)crates/biome_html_formatter/src/svelte/auxiliary/debug_block.rs (1)
fmt_fields(9-26)crates/biome_html_syntax/src/generated/nodes.rs (1)
svelte_ident_token(921-923)
crates/biome_html_formatter/src/svelte/mod.rs (1)
xtask/codegen/src/js_kinds_src.rs (1)
lists(549-551)
crates/biome_html_formatter/src/svelte/bogus/mod.rs (2)
crates/biome_html_formatter/src/html/bogus/mod.rs (1)
bogus(4-4)crates/biome_js_formatter/src/js/bogus/mod.rs (1)
bogus(4-4)
crates/biome_html_formatter/src/svelte/auxiliary/debug_block.rs (3)
crates/biome_html_formatter/src/lib.rs (6)
fmt_fields(247-247)format(51-51)format(64-66)format(81-86)format(101-103)format(297-299)crates/biome_html_syntax/src/generated/nodes.rs (5)
sv_curly_at_token(874-876)debug_token(877-879)bindings(880-882)r_curly_token(729-731)r_curly_token(883-885)crates/biome_formatter/src/builders.rs (1)
space(606-608)
crates/biome_html_parser/src/syntax/mod.rs (2)
crates/biome_html_syntax/src/file_source.rs (1)
svelte(96-100)crates/biome_html_parser/src/syntax/svelte.rs (1)
parse_svelte_at_block(14-25)
crates/biome_html_parser/src/syntax/svelte.rs (2)
crates/biome_html_parser/src/syntax/parse_error.rs (1)
expected_svelte_closing_block(96-98)crates/biome_html_parser/src/syntax/mod.rs (4)
parse_element(114-187)parse_element(221-251)parse_element(281-283)parse_element(561-592)
crates/biome_html_formatter/src/separated.rs (2)
crates/biome_html_formatter/src/lib.rs (3)
format_node(32-42)new(146-148)options(156-158)crates/biome_html_formatter/src/trivia.rs (2)
on_skipped(43-45)on_removed(47-49)
crates/biome_html_formatter/src/svelte/any/block.rs (2)
crates/biome_html_formatter/src/lib.rs (3)
fmt(184-191)fmt(209-218)fmt(289-291)crates/biome_html_formatter/src/generated.rs (13)
fmt(14-20)fmt(52-58)fmt(90-96)fmt(128-134)fmt(160-166)fmt(198-204)fmt(236-242)fmt(274-280)fmt(312-318)fmt(350-356)fmt(390-396)fmt(428-434)fmt(466-472)
crates/biome_html_parser/src/lexer/mod.rs (2)
crates/biome_html_syntax/src/file_source.rs (1)
is_svelte(59-61)crates/biome_html_parser/src/token_source.rs (1)
current(156-158)
crates/biome_html_formatter/src/generated.rs (1)
crates/biome_html_formatter/src/lib.rs (10)
format(51-51)format(64-66)format(81-86)format(101-103)format(297-299)new(146-148)into_format(112-112)into_format(121-123)into_format(135-137)into_format(305-307)
🪛 LanguageTool
.changeset/nine-bottles-float.md
[style] ~5-~5: As a shorter alternative for ‘able to’, consider using “can now”.
Context: ...yntax {@debug}. The Biome HTML parser is now able to parse and format the blocks: ```diff -...
(BE_ABLE_TO)
⏰ 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: Documentation
- GitHub Check: End-to-end tests
- GitHub Check: Check Dependencies
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: autofix
- GitHub Check: Test Node.js API
- GitHub Check: Parser conformance
🔇 Additional comments (24)
crates/biome_html_parser/tests/html_specs/error/svelte/debug.svelte (1)
1-2: Verify line 2 is an intentional error case.Line 2 (
{@debug something}) appears syntactically valid based on the ok test case incrates/biome_html_parser/tests/html_specs/ok/svelte/debug.svelte. Is this testing parser recovery after the Line 1 error, or should Line 2 be in a separate test?crates/biome_html_formatter/tests/specs/html/svelte/debug.svelte (1)
1-6: Good test coverage for Svelte debug blocks.The test cases cover empty debug blocks, single bindings, and multiple bindings with varied spacing. This will properly exercise the formatting implementation.
crates/biome_html_formatter/src/svelte/any/mod.rs (1)
1-3: LGTM!Standard generated module structure.
crates/biome_html_formatter/src/svelte/bogus/mod.rs (1)
1-3: LGTM!Standard generated module structure for bogus block handling.
crates/biome_html_parser/src/syntax/mod.rs (4)
3-3: LGTM!Clean module addition for Svelte parsing support.
8-8: LGTM!Appropriate import for the Svelte at-block parser.
230-230: LGTM!The integration follows the existing pattern for text expressions. The
{@token properly delegates to the Svelte parser.
497-497: LGTM!Good improvement converting to a doc comment.
crates/biome_html_formatter/src/svelte/auxiliary/mod.rs (1)
1-4: LGTM!Standard generated module structure for Svelte auxiliary formatters.
crates/biome_html_parser/src/token_source.rs (1)
35-39: LGTM!The new
Sveltelexing context is well-documented and clearly explains its purpose for tokenising Svelte-specific keywords.crates/biome_html_parser/src/lexer/tests.rs (2)
335-364: LGTM!Comprehensive test coverage for all Svelte opening token types (
{@,{/,{:,{#). The assertions properly verify token kinds and lengths.
366-375: LGTM!Good test for Svelte keyword tokenisation in the Svelte context. Validates that
debugis properly recognised asDEBUG_KWwith surrounding whitespace handled correctly.crates/biome_html_formatter/src/lib.rs (2)
23-24: LGTM! Module structure follows existing patterns.The new
separatedandsveltemodules are properly declared and integrate cleanly with the existing formatter architecture.
29-29: Nice catch on the capitalisation.Consistent "HTML" capitalisation improves readability.
crates/biome_html_formatter/src/svelte/lists/mod.rs (1)
1-3: LGTM! Generated module follows conventions.The generated module declaration properly exposes the binding list formatter.
xtask/codegen/src/html_kinds_src.rs (3)
24-24: LGTM! Svelte debug keyword added appropriately.The
debugkeyword addition aligns with the Svelte debug block implementation described in the PR objectives.
56-62: Nice organisation with section comments.The Astro/Svelte node grouping with inline comments improves maintainability and makes the node categorisation clear.
18-22: COMMA token naming is intentional and consistent with project conventions — no changes needed.The COMMA token is used identically across JSON, JavaScript, CSS, YAML, Markdown, GraphQL, and Grit—not just Svelte. The naming convention reserves the
SV_prefix for Svelte-specific punctuators (SV_CURLY_AT, SV_CURLY_HASH, etc.), whilst universal punctuators like COMMA, SEMICOLON, and COLON remain prefix-free. This is exactly how it should be.Likely an incorrect or invalid review comment.
crates/biome_html_formatter/src/svelte/bogus/bogus_block.rs (1)
1-5: LGTM! Bogus node formatter follows established pattern.The implementation correctly delegates to the default
FormatBogusNodeRulebehaviour, consistent with other bogus formatters in the codebase.crates/biome_html_formatter/src/trivia.rs (1)
43-49: LGTM! Trivia helpers match existing formatter patterns.The
on_skippedandon_removedfunctions follow the exact pattern used in CSS, JS, JSON, and GraphQL formatters, ensuring consistency across the codebase.crates/biome_html_formatter/src/svelte/any/block.rs (1)
5-15: LGTM! Generated Any formatter follows conventions.*The pattern-matching delegation to inner node formatters is the standard approach and correctly handles both
SvelteBogusBlockandSvelteDebugBlockvariants.crates/biome_html_formatter/src/svelte/auxiliary/name.rs (1)
5-12: LGTM! Simple and focused formatter.The implementation correctly extracts and formats the
svelte_ident_token, following the standardFormatNodeRulepattern.crates/biome_html_formatter/src/svelte/lists/binding_list.rs (1)
9-18: No issues found—formatting implementation is correct.The snapshot test confirms the implementation produces the expected output. The
format_separated(",")yields formatted elements that include their comma separators, and thejoinerwithspace()normalises spacing between them, resulting in the correctfoo, bar, bazformat for{@debug}binding lists.crates/biome_html_formatter/src/separated.rs (1)
73-101: Neat extension hook! Option-threading lines up perfectly with our separated iterators, so I’ve nothing else to nitpick. Cheers.
dyc3
left a comment
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.
no notes, looks good
Summary
Closes #7962
Part of #7929
I made sure to divide the commits:
As for now, I followed @dyc3's advice so we can identify the opening block only by using a specific sequence of characters.
As for the keywords, I created a specific context so we can safely consume
if,else,debug, etc., without clashing with other possible identifiers that we have in the future.The function
consume_identifiernow receives an enum, so we can safely parse identifiers, since HTML and Svelte have different requirements.One part that I am not sure about , that I would like to review later is the
SvelteNamepart. As for now I added it because@debugdoesn't accept expressions, but only bindings. Since this is the first name we added to language, the formatter implementation hardcodes a Svelte node. I added aTODOfor the future.Test Plan
Added various tests
Docs