Skip to content

Conversation

@ematipico
Copy link
Member

Summary

Closes #7962
Part of #7929

I made sure to divide the commits:

  • lexer
  • parser
  • the rest

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_identifier now 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 SvelteName part. As for now I added it because @debug doesn'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 a TODO for the future.

Test Plan

Added various tests

Docs

@changeset-bot
Copy link

changeset-bot bot commented Nov 3, 2025

🦋 Changeset detected

Latest commit: df44d16

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

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

@ematipico ematipico requested review from a team and dyc3 November 3, 2025 15:04
@github-actions github-actions bot added A-Parser Area: parser A-Formatter Area: formatter A-Tooling Area: internal tools L-HTML Language: HTML and super languages labels Nov 3, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 50901 50901 0
Passed 49697 49697 0
Failed 1162 1162 0
Panics 42 42 0
Coverage 97.63% 97.63% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 40 40 0
Passed 37 37 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.50% 92.50% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6320 6320 0
Passed 2106 2106 0
Failed 4214 4214 0
Panics 0 0 0
Coverage 33.32% 33.32% 0.00%

ts/babel

Test result main count This PR count Difference
Total 835 835 0
Passed 742 742 0
Failed 93 93 0
Panics 0 0 0
Coverage 88.86% 88.86% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 18813 18813 0
Passed 14065 14065 0
Failed 4747 4747 0
Panics 1 1 0
Coverage 74.76% 74.76% 0.00%

@ematipico ematipico changed the title feat(html): implement svelte identifier without breaking tests feat(html): implement {@debug} parsing Nov 3, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 3, 2025

Walkthrough

Adds 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

  • dyc3
  • arendjr

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'feat(html): implement {@debug} parsing' clearly and specifically describes the main change in the changeset. It follows conventional commit format and concisely summarises the primary feature being added—Svelte {@debug} block parsing support.
Description check ✅ Passed The description provides a comprehensive explanation of the changes, including closure of issue #7962 and relation to #7929. It outlines the implementation strategy (contextual identifier parsing), commit organisation (lexer, parser, other), and notes areas for future review. The description is clearly related to the changeset and provides meaningful context about the implementation decisions.
Linked Issues check ✅ Passed The PR successfully implements Svelte {@debug} parsing as required by issue #7962. The changes include lexer enhancements to recognise Svelte-specific tokens, parser extensions to handle debug blocks with binding lists, and formatter implementations for the new node types. The implementation introduces contextual identifier parsing to safely consume Svelte keywords, adds new tokens (SV_CURLY_AT, DEBUG_KW), and provides comprehensive test coverage for the new functionality.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing {@debug} parsing support. The modifications span lexer enhancements, parser logic, AST node definitions, formatter implementations, and test cases—all scoped to Svelte debug block functionality. Minor documentation updates (e.g., HTML capitalisation) and tooling changes are incidental to the core feature and reasonably within scope.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/html-svelte-debug

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ad50823 and df44d16.

📒 Files selected for processing (1)
  • crates/biome_html_parser/src/lexer/mod.rs (19 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{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/lexer/mod.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/lexer/mod.rs
🧠 Learnings (12)
📓 Common learnings
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
📚 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/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 : Do not attempt to fix code; if a mandatory token/node is missing, return `None` instead

Applied to files:

  • crates/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/lib.rs : Implement FormatLanguage for HtmlFormatLanguage with associated types: SyntaxLanguage=HtmlLanguage, Context=HtmlFormatContext, FormatRule=FormatHtmlSyntaxNode

Applied to files:

  • crates/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/comments.rs : Expose a public HtmlComments type alias: `pub type HtmlComments = Comments<HtmlLanguage>;`

Applied to files:

  • crates/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/comments.rs : Define HtmlCommentStyle implementing CommentStyle in comments.rs

Applied to files:

  • crates/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/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/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/xtask/codegen/*.ungram : Nodes for enclosing syntax errors must include the Bogus word (e.g., HtmlBogusAttribute)

Applied to files:

  • crates/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 : For non-mandatory tokens, use the provided helper constructors (e.g., `token`, `space_token`, `dynamic_token`)

Applied to files:

  • crates/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/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/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_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/tests/language.rs : Create tests/language.rs defining `HtmlTestFormatLanguage` and implement the TestFormatLanguage trait

Applied to files:

  • crates/biome_html_parser/src/lexer/mod.rs
🧬 Code graph analysis (1)
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)
⏰ 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)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: End-to-end tests
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: autofix
  • GitHub Check: Parser conformance
  • GitHub Check: Test Node.js API
🔇 Additional comments (8)
crates/biome_html_parser/src/lexer/mod.rs (8)

4-6: LGTM!

The new token kinds DEBUG_KW and SVELTE_IDENT are correctly imported for Svelte support.


38-52: LGTM!

The IdentifierContext enum is a clean refactor from the previous boolean parameter, making the code more maintainable and extensible.


78-104: LGTM!

The Svelte opening block detection and identifier routing are correctly integrated. The condition on line 100 properly excludes attribute names immediately after <, as tag names are already handled on lines 94-98.


389-435: LGTM!

The refactor to IdentifierContext is excellent. The DEBUG_KW check on line 431 cleverly uses self.current_kind == T!["{@"] to distinguish the directive keyword from bindings named "debug", correctly handling cases like {@debug debug}.


349-361: LGTM!

The consume_svelte method correctly handles Svelte-specific tokenisation, including nested blocks, identifiers, and expression content.


590-606: LGTM!

The Svelte opening block detection and consumption correctly handle all four block types ({@, {#, {:, {/). The unimplemented! on lines 599-602 is appropriate as a defensive guard for an unreachable code path.

Also applies to: 667-674


990-998: LGTM!

The identifier validation functions correctly enforce standard rules: identifiers must start with a letter or underscore, but can continue with alphanumerics or underscores.


123-123: Verify whether <, is a supported construct.

The comma guard at line 123 (if self.current() == T![<]) appears inconsistent with the Svelte context (line 353), where commas are consumed without conditions. In Svelte, commas typically appear within bindings like {@debug a, b, c}, not after <. The < and / guards form valid sequences (<!, </), but <, remains unclear. Search found no test cases or documentation explaining this.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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_block suggests a missing closing brace, but the diagnostic message is "Expected an identifier." This mismatch may confuse future readers. Consider renaming to expected_svelte_identifier to 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

📥 Commits

Reviewing files that changed from the base of the PR and between 547c2da and 0900e23.

⛔ Files ignored due to path filters (10)
  • crates/biome_html_factory/src/generated/node_factory.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_html_factory/src/generated/syntax_factory.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_html_formatter/tests/specs/html/svelte/debug.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/error/svelte/debug.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/ok/svelte/debug.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_syntax/src/generated/kind.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_html_syntax/src/generated/macros.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_html_syntax/src/generated/nodes.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_html_syntax/src/generated/nodes_mut.rs is 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.rs
  • crates/biome_html_parser/src/token_source.rs
  • crates/biome_html_formatter/src/lib.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/mod.rs
  • xtask/codegen/src/js_kinds_src.rs
  • crates/biome_html_parser/tests/spec_test.rs
  • crates/biome_html_formatter/src/trivia.rs
  • crates/biome_html_formatter/src/svelte/lists/binding_list.rs
  • crates/biome_html_formatter/src/svelte/any/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/name.rs
  • crates/biome_html_formatter/src/svelte/mod.rs
  • crates/biome_html_formatter/src/html/any/text_expression.rs
  • xtask/codegen/src/html_kinds_src.rs
  • crates/biome_html_formatter/src/svelte/lists/mod.rs
  • crates/biome_html_formatter/src/svelte/bogus/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/debug_block.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • xtask/codegen/src/generate_nodes.rs
  • crates/biome_html_parser/src/syntax/svelte.rs
  • crates/biome_html_formatter/src/separated.rs
  • crates/biome_html_parser/src/lexer/tests.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/biome_html_formatter/src/generated.rs
  • crates/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.rs
  • crates/biome_html_parser/src/token_source.rs
  • crates/biome_html_formatter/src/lib.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/mod.rs
  • xtask/codegen/src/js_kinds_src.rs
  • crates/biome_html_parser/tests/spec_test.rs
  • crates/biome_html_formatter/src/trivia.rs
  • crates/biome_html_formatter/src/svelte/lists/binding_list.rs
  • crates/biome_html_formatter/src/svelte/any/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/name.rs
  • crates/biome_html_formatter/src/svelte/mod.rs
  • crates/biome_html_formatter/src/html/any/text_expression.rs
  • xtask/codegen/src/html_kinds_src.rs
  • crates/biome_html_formatter/src/svelte/lists/mod.rs
  • crates/biome_html_formatter/src/svelte/bogus/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/debug_block.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • xtask/codegen/src/generate_nodes.rs
  • crates/biome_html_parser/src/syntax/svelte.rs
  • crates/biome_html_formatter/src/separated.rs
  • crates/biome_html_parser/src/lexer/tests.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/biome_html_formatter/src/generated.rs
  • crates/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.rs
  • crates/biome_html_parser/tests/html_specs/error/svelte/debug.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/debug.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/debug.svelte
  • crates/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.rs
  • xtask/codegen/src/html_kinds_src.rs
  • crates/biome_html_formatter/src/svelte/bogus/mod.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • xtask/codegen/html.ungram
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/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.rs
  • crates/biome_html_parser/src/token_source.rs
  • crates/biome_html_formatter/src/lib.rs
  • xtask/codegen/src/js_kinds_src.rs
  • crates/biome_html_parser/tests/spec_test.rs
  • crates/biome_html_formatter/src/trivia.rs
  • crates/biome_html_formatter/src/svelte/lists/binding_list.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/name.rs
  • crates/biome_html_formatter/src/html/any/text_expression.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/debug_block.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_parser/src/syntax/svelte.rs
  • crates/biome_html_formatter/src/separated.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/biome_html_formatter/src/generated.rs
  • crates/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.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/mod.rs
  • crates/biome_html_formatter/src/svelte/any/mod.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.svelte
  • crates/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.rs
  • crates/biome_html_formatter/src/trivia.rs
  • crates/biome_html_formatter/src/svelte/any/mod.rs
  • crates/biome_html_formatter/src/svelte/bogus/mod.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • xtask/codegen/src/generate_nodes.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/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.rs
  • xtask/codegen/src/js_kinds_src.rs
  • xtask/codegen/src/html_kinds_src.rs
  • crates/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.rs
  • crates/biome_html_formatter/src/lib.rs
  • crates/biome_html_formatter/src/trivia.rs
  • crates/biome_html_formatter/src/svelte/lists/binding_list.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/name.rs
  • crates/biome_html_formatter/src/html/any/text_expression.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/debug_block.rs
  • crates/biome_html_formatter/src/separated.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/biome_html_formatter/src/generated.rs
  • crates/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.rs
  • xtask/codegen/src/js_kinds_src.rs
  • crates/biome_html_formatter/src/trivia.rs
  • xtask/codegen/src/html_kinds_src.rs
  • xtask/codegen/src/generate_nodes.rs
  • crates/biome_html_parser/src/lexer/tests.rs
  • crates/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.rs
  • crates/biome_html_formatter/src/lib.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/mod.rs
  • crates/biome_html_formatter/src/svelte/any/mod.rs
  • crates/biome_html_formatter/src/svelte/mod.rs
  • crates/biome_html_formatter/src/svelte/lists/mod.rs
  • crates/biome_html_formatter/src/svelte/bogus/mod.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_parser/src/syntax/svelte.rs
  • crates/biome_html_parser/src/lexer/tests.rs
  • crates/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.rs
  • xtask/codegen/src/js_kinds_src.rs
  • crates/biome_html_formatter/src/trivia.rs
  • crates/biome_html_formatter/src/svelte/lists/binding_list.rs
  • xtask/codegen/src/html_kinds_src.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/debug_block.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • xtask/codegen/src/generate_nodes.rs
  • crates/biome_html_formatter/src/separated.rs
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/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.rs
  • crates/biome_html_formatter/src/lib.rs
  • xtask/codegen/src/js_kinds_src.rs
  • crates/biome_html_formatter/src/trivia.rs
  • crates/biome_html_formatter/src/separated.rs
  • crates/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.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/mod.rs
  • crates/biome_html_parser/tests/spec_test.rs
  • crates/biome_html_formatter/src/trivia.rs
  • crates/biome_html_formatter/src/svelte/lists/binding_list.rs
  • crates/biome_html_formatter/src/svelte/any/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/name.rs
  • crates/biome_html_formatter/src/svelte/mod.rs
  • crates/biome_html_formatter/src/html/any/text_expression.rs
  • crates/biome_html_formatter/src/svelte/lists/mod.rs
  • crates/biome_html_formatter/src/svelte/bogus/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/debug_block.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_formatter/src/separated.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_formatter/src/generated.rs
  • crates/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.rs
  • crates/biome_html_parser/tests/spec_test.rs
  • crates/biome_html_formatter/src/trivia.rs
  • crates/biome_html_formatter/src/svelte/lists/binding_list.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/name.rs
  • crates/biome_html_formatter/src/html/any/text_expression.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/debug_block.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_formatter/src/separated.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_formatter/src/generated.rs
  • crates/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.rs
  • crates/biome_html_formatter/src/trivia.rs
  • crates/biome_html_formatter/src/svelte/lists/binding_list.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/name.rs
  • crates/biome_html_formatter/src/html/any/text_expression.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/debug_block.rs
  • crates/biome_html_formatter/src/separated.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_formatter/src/generated.rs
  • crates/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.rs
  • xtask/codegen/src/js_kinds_src.rs
  • crates/biome_html_parser/tests/spec_test.rs
  • crates/biome_html_formatter/src/trivia.rs
  • crates/biome_html_formatter/src/svelte/lists/binding_list.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/name.rs
  • crates/biome_html_formatter/src/html/any/text_expression.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/debug_block.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_formatter/src/separated.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/biome_html_formatter/src/generated.rs
  • crates/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.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/mod.rs
  • crates/biome_html_formatter/src/svelte/lists/binding_list.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/name.rs
  • crates/biome_html_formatter/src/svelte/mod.rs
  • crates/biome_html_formatter/src/svelte/lists/mod.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_formatter/src/generated.rs
  • crates/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.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/mod.rs
  • crates/biome_html_formatter/src/svelte/any/mod.rs
  • crates/biome_html_formatter/src/svelte/mod.rs
  • crates/biome_html_formatter/src/svelte/lists/mod.rs
  • crates/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.rs
  • crates/biome_html_formatter/src/trivia.rs
  • crates/biome_html_formatter/src/svelte/lists/binding_list.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/name.rs
  • crates/biome_html_formatter/src/html/any/text_expression.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/debug_block.rs
  • crates/biome_html_formatter/src/separated.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_formatter/src/generated.rs
  • crates/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.rs
  • crates/biome_html_formatter/src/trivia.rs
  • crates/biome_html_formatter/src/svelte/lists/binding_list.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/name.rs
  • crates/biome_html_formatter/src/html/any/text_expression.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/debug_block.rs
  • crates/biome_html_formatter/src/separated.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_formatter/src/generated.rs
  • crates/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.rs
  • xtask/codegen/src/js_kinds_src.rs
  • crates/biome_html_parser/tests/spec_test.rs
  • crates/biome_html_formatter/src/trivia.rs
  • crates/biome_html_formatter/src/svelte/lists/binding_list.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/name.rs
  • crates/biome_html_formatter/src/html/any/text_expression.rs
  • crates/biome_html_parser/tests/html_specs/error/svelte/debug.svelte
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_parser/tests/html_specs/ok/svelte/debug.svelte
  • crates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.svelte
  • crates/biome_html_formatter/src/separated.rs
  • crates/biome_html_parser/src/lexer/tests.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/biome_html_formatter/src/generated.rs
  • crates/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.rs
  • crates/biome_html_formatter/src/svelte/any/mod.rs
  • crates/biome_html_formatter/src/svelte/mod.rs
  • crates/biome_html_formatter/src/svelte/lists/mod.rs
  • crates/biome_html_formatter/src/svelte/bogus/mod.rs
  • 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/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.rs
  • crates/biome_html_formatter/src/svelte/any/mod.rs
  • crates/biome_html_formatter/src/svelte/mod.rs
  • crates/biome_html_formatter/src/svelte/lists/mod.rs
  • crates/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.rs
  • crates/biome_html_formatter/src/svelte/any/mod.rs
  • crates/biome_html_formatter/src/svelte/mod.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_parser/tests/html_specs/ok/svelte/debug.svelte
  • crates/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.rs
  • crates/biome_html_parser/tests/html_specs/error/svelte/debug.svelte
  • crates/biome_html_formatter/src/svelte/auxiliary/debug_block.rs
  • crates/biome_html_parser/tests/html_specs/ok/svelte/debug.svelte
  • crates/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.rs
  • 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/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.rs
  • xtask/codegen/src/html_kinds_src.rs
  • crates/biome_html_formatter/src/svelte/lists/mod.rs
  • crates/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.rs
  • xtask/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.rs
  • crates/biome_html_formatter/src/svelte/mod.rs
  • crates/biome_html_parser/tests/html_specs/error/svelte/debug.svelte
  • crates/biome_html_formatter/src/svelte/bogus/mod.rs
  • crates/biome_html_parser/tests/html_specs/ok/svelte/debug.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/debug.svelte
  • crates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.svelte
  • crates/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.rs
  • crates/biome_html_parser/tests/html_specs/error/svelte/debug.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/debug.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/debug.svelte
  • crates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.svelte
  • crates/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.rs
  • crates/biome_html_parser/tests/html_specs/error/svelte/debug.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/debug.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/debug.svelte
  • crates/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.rs
  • crates/biome_html_parser/tests/html_specs/error/svelte/debug.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/debug.svelte
  • crates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.svelte
  • crates/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.rs
  • crates/biome_html_parser/tests/html_specs/error/svelte/debug.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/debug.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/debug.svelte
  • crates/biome_html_parser/tests/html_specs/error/svelte/debug-trailing-comma.svelte
  • crates/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.rs
  • crates/biome_html_formatter/src/svelte/mod.rs
  • crates/biome_html_formatter/src/svelte/lists/mod.rs
  • crates/biome_html_formatter/src/svelte/bogus/mod.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/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.rs
  • crates/biome_html_formatter/src/svelte/mod.rs
  • crates/biome_html_formatter/src/svelte/lists/mod.rs
  • crates/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.rs
  • crates/biome_html_formatter/src/html/any/text_expression.rs
  • xtask/codegen/src/html_kinds_src.rs
  • crates/biome_html_formatter/src/svelte/bogus/mod.rs
  • xtask/codegen/html.ungram
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/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.rs
  • 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/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.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/debug.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/debug.svelte
  • crates/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.svelte
  • crates/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.rs
  • crates/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.svelte
  • crates/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.rs
  • crates/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 in crates/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 Svelte lexing 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 debug is properly recognised as DEBUG_KW with surrounding whitespace handled correctly.

crates/biome_html_formatter/src/lib.rs (2)

23-24: LGTM! Module structure follows existing patterns.

The new separated and svelte modules 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 debug keyword 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 FormatBogusNodeRule behaviour, 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_skipped and on_removed functions 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 SvelteBogusBlock and SvelteDebugBlock variants.

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 standard FormatNodeRule pattern.

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 the joiner with space() normalises spacing between them, resulting in the correct foo, bar, baz format 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.

Copy link
Contributor

@dyc3 dyc3 left a 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

@ematipico ematipico merged commit 425963d into main Nov 3, 2025
14 checks passed
@ematipico ematipico deleted the feat/html-svelte-debug branch November 3, 2025 16:14
@github-actions github-actions bot mentioned this pull request Nov 3, 2025
l0ngvh pushed a commit to l0ngvh/biome that referenced this pull request Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Formatter Area: formatter A-Parser Area: parser A-Tooling Area: internal tools L-HTML Language: HTML and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement svelte {@debug}

3 participants