Skip to content

Conversation

@ematipico
Copy link
Member

Summary

Closes #8014
Closes #8015
Closes #8016
Closes #8017

The implementation fo these new blocks/attributes was fairly simple and standard.

Test Plan

Added various tests

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Nov 6, 2025

🦋 Changeset detected

Latest commit: 0e554fc

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

@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 6, 2025
if !is_at_attribute_start(p) {
return Absent;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Below I moved the if/else if/else blocks to a match

Comment on lines -79 to +82
p.expect_with_context(T!['}'], HtmlLexContext::InsideTag);
p.expect(T!['}']);
Copy link
Member Author

Choose a reason for hiding this comment

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

We aren't inside the tag. It was a bug


p.expect_with_context(keyword, HtmlLexContext::Svelte);

p.expect_with_context(T!['}'], HtmlLexContext::InsideTag);
Copy link
Member Author

Choose a reason for hiding this comment

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

We aren't inside the tag. It was a bug

@ematipico ematipico requested review from a team November 6, 2025 11:25
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 50977 50977 0
Passed 49765 49765 0
Failed 1170 1170 0
Panics 42 42 0
Coverage 97.62% 97.62% 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%

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 6, 2025

Walkthrough

This PR adds parsing and formatting support for four Svelte constructs: {@render}, {@html}, {@attach}, and {@const}. It introduces new lexer keywords (RENDER_KW, CONST_KW, ATTACH_KW, HTML_KW), parser handlers and AST kinds for the blocks/attribute, formatter rules and wiring in the HTML formatter, and tests for ok/error cases. Formatting normalises spacing around the directives but does not format the inner expressions.

Possibly related PRs

Suggested reviewers

  • dyc3
  • arendjr

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 47.73% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarises the main change: implementing parsing support for new Svelte blocks.
Description check ✅ Passed The description clearly links to relevant issues (#8014-#8017) and explains the implementation scope.
Linked Issues check ✅ Passed The PR implements parsing for all four linked issues: {@render} [#8014], {@html} [#8015], {@Attach} [#8016], and {@const} [#8017].
Out of Scope Changes check ✅ Passed All changes directly support the four new Svelte constructs; parser enhancements, formatter rules, and test coverage remain focused on the stated objectives.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/attach-html-render

📜 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 eda5e00 and 0e554fc.

📒 Files selected for processing (1)
  • .changeset/light-toys-check.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/light-toys-check.md
⏰ 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: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Check Dependencies
  • GitHub Check: Documentation
  • GitHub Check: End-to-end tests
  • GitHub Check: Test Node.js API
  • GitHub Check: autofix
  • GitHub Check: Parser conformance

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: 1

🧹 Nitpick comments (6)
crates/biome_html_parser/src/lexer/tests.rs (1)

366-379: LGTM! Consider expanding test coverage.

The test correctly validates single_expression() context handling. Token lengths match input strings exactly.

For future iterations, consider edge cases like empty expressions or special characters—but the current coverage is sufficient for this PR.

.changeset/mean-carrots-peel.md (1)

5-5: Consider simplifying the wording.

The static analysis tool suggests using "can" instead of "is able to" for more concise wording:

-Added support Svelte syntax `{@const}`. Biome now is able to parse and format the Svelte syntax [`{@const}`](https://svelte.dev/docs/svelte/@const):
+Added support Svelte syntax `{@const}`. Biome can now parse and format the Svelte syntax [`{@const}`](https://svelte.dev/docs/svelte/@const):
.changeset/brown-poets-sit.md (1)

5-5: Consider simplifying the wording.

The static analysis tool suggests using "can" instead of "is able to" for more concise wording:

-Added support Svelte syntax `{@render}`. Biome now is able to parse and format the Svelte syntax [`{@render}`](https://svelte.dev/docs/svelte/@render):
+Added support Svelte syntax `{@render}`. Biome can now parse and format the Svelte syntax [`{@render}`](https://svelte.dev/docs/svelte/@render):
.changeset/all-tips-hang.md (1)

6-6: Consider simplifying the wording.

The static analysis tool suggests using "can" instead of "is able to" for more concise wording:

-Added support Svelte syntax `{@html}`. Biome now is able to parse and format the Svelte syntax [`{@html}`](https://svelte.dev/docs/svelte/@html):
+Added support Svelte syntax `{@html}`. Biome can now parse and format the Svelte syntax [`{@html}`](https://svelte.dev/docs/svelte/@html):
.changeset/icy-planes-leave.md (1)

5-5: Consider simplifying the wording.

You could replace "is able to parse" with "can parse" for brevity.

Apply this diff:

-Added support Svelte syntax `{@attach}`. Biome now is able to parse and format the Svelte syntax [`{@attach}`](https://svelte.dev/docs/svelte/@attach):
+Added support Svelte syntax `{@attach}`. Biome can now parse and format the Svelte syntax [`{@attach}`](https://svelte.dev/docs/svelte/@attach):
crates/biome_html_parser/src/syntax/svelte.rs (1)

139-199: Consider extracting common parsing logic.

The functions parse_html_block, parse_render_block, and parse_const_block follow an identical pattern:

  1. Check token
  2. Bump with single_expression context
  3. Parse text expression
  4. Expect closing brace
  5. Complete with node type

Whilst the duplication is minor, a helper function could reduce maintenance burden:

fn parse_simple_at_block(
    p: &mut HtmlParser,
    marker: Marker,
    token: HtmlSyntaxKind,
    node_kind: HtmlSyntaxKind,
) -> ParsedSyntax {
    if !p.at(token) {
        return Absent;
    }
    p.bump_with_context(token, HtmlLexContext::single_expression());
    
    TextExpression::new_single()
        .parse_element(p)
        .or_add_diagnostic(p, expected_text_expression);
    
    p.expect(T!['}']);
    
    Present(marker.complete(p, node_kind))
}
📜 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 5c55347 and eda5e00.

⛔ Files ignored due to path filters (18)
  • 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/attach.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_formatter/tests/specs/html/svelte/const.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_formatter/tests/specs/html/svelte/html.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_formatter/tests/specs/html/svelte/render.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/error/svelte/attach.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/error/svelte/const.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/error/svelte/html.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/error/svelte/render.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/ok/svelte/attach.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/ok/svelte/const.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/ok/svelte/html.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/ok/svelte/render.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 (34)
  • .changeset/all-tips-hang.md (1 hunks)
  • .changeset/brown-poets-sit.md (1 hunks)
  • .changeset/icy-planes-leave.md (1 hunks)
  • .changeset/light-toys-check.md (1 hunks)
  • .changeset/mean-carrots-peel.md (1 hunks)
  • crates/biome_html_formatter/src/generated.rs (3 hunks)
  • crates/biome_html_formatter/src/html/any/attribute.rs (1 hunks)
  • crates/biome_html_formatter/src/html/lists/attribute_list.rs (1 hunks)
  • crates/biome_html_formatter/src/svelte/any/block.rs (1 hunks)
  • crates/biome_html_formatter/src/svelte/auxiliary/attach_attribute.rs (1 hunks)
  • crates/biome_html_formatter/src/svelte/auxiliary/const_block.rs (1 hunks)
  • crates/biome_html_formatter/src/svelte/auxiliary/html_block.rs (1 hunks)
  • crates/biome_html_formatter/src/svelte/auxiliary/mod.rs (1 hunks)
  • crates/biome_html_formatter/src/svelte/auxiliary/render_block.rs (1 hunks)
  • crates/biome_html_formatter/tests/specs/html/svelte/attach.svelte (1 hunks)
  • crates/biome_html_formatter/tests/specs/html/svelte/const.svelte (1 hunks)
  • crates/biome_html_formatter/tests/specs/html/svelte/html.svelte (1 hunks)
  • crates/biome_html_formatter/tests/specs/html/svelte/render.svelte (1 hunks)
  • crates/biome_html_parser/src/lexer/mod.rs (2 hunks)
  • crates/biome_html_parser/src/lexer/tests.rs (1 hunks)
  • crates/biome_html_parser/src/syntax/mod.rs (6 hunks)
  • crates/biome_html_parser/src/syntax/parse_error.rs (2 hunks)
  • crates/biome_html_parser/src/syntax/svelte.rs (5 hunks)
  • crates/biome_html_parser/tests/html_specs/error/svelte/attach.svelte (1 hunks)
  • crates/biome_html_parser/tests/html_specs/error/svelte/const.svelte (1 hunks)
  • crates/biome_html_parser/tests/html_specs/error/svelte/html.svelte (1 hunks)
  • crates/biome_html_parser/tests/html_specs/error/svelte/render.svelte (1 hunks)
  • crates/biome_html_parser/tests/html_specs/ok/svelte/attach.svelte (1 hunks)
  • crates/biome_html_parser/tests/html_specs/ok/svelte/const.svelte (1 hunks)
  • crates/biome_html_parser/tests/html_specs/ok/svelte/html.svelte (1 hunks)
  • crates/biome_html_parser/tests/html_specs/ok/svelte/render.svelte (1 hunks)
  • crates/biome_html_parser/tests/spec_test.rs (1 hunks)
  • xtask/codegen/html.ungram (3 hunks)
  • xtask/codegen/src/html_kinds_src.rs (2 hunks)
🧰 Additional context used
🧠 Learnings (35)
📚 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/html/any/attribute.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/const_block.rs
  • crates/biome_html_formatter/src/html/lists/attribute_list.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/render_block.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/attach_attribute.rs
  • crates/biome_html_parser/src/syntax/svelte.rs
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/html_block.rs
  • crates/biome_html_formatter/src/generated.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/html/any/attribute.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/const_block.rs
  • crates/biome_html_formatter/src/html/lists/attribute_list.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/render_block.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/attach_attribute.rs
  • crates/biome_html_parser/src/syntax/svelte.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/html_block.rs
  • crates/biome_html_formatter/src/generated.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/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_formatter/src/html/any/attribute.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_parser/src/syntax/parse_error.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/const_block.rs
  • crates/biome_html_formatter/src/html/lists/attribute_list.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/render_block.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/attach_attribute.rs
  • crates/biome_html_parser/src/lexer/tests.rs
  • crates/biome_html_parser/src/syntax/svelte.rs
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/html_block.rs
  • crates/biome_html_formatter/src/generated.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/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/html/any/attribute.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_formatter/tests/specs/html/svelte/html.svelte
  • crates/biome_html_parser/tests/spec_test.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/const_block.rs
  • crates/biome_html_formatter/src/html/lists/attribute_list.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/render_block.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/attach_attribute.rs
  • crates/biome_html_parser/src/syntax/svelte.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/html_block.rs
  • crates/biome_html_formatter/src/generated.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/mod.rs
  • crates/biome_html_parser/tests/html_specs/ok/svelte/render.svelte
📚 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/html/any/attribute.rs
  • crates/biome_html_parser/tests/html_specs/error/svelte/attach.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/html.svelte
  • crates/biome_html_parser/tests/spec_test.rs
  • crates/biome_html_parser/tests/html_specs/ok/svelte/html.svelte
  • crates/biome_html_formatter/src/svelte/auxiliary/render_block.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/attach_attribute.rs
  • crates/biome_html_parser/src/lexer/tests.rs
  • crates/biome_html_parser/tests/html_specs/ok/svelte/const.svelte
  • crates/biome_html_parser/tests/html_specs/error/svelte/const.svelte
  • crates/biome_html_formatter/src/svelte/auxiliary/html_block.rs
  • crates/biome_html_formatter/src/generated.rs
  • crates/biome_html_formatter/tests/specs/html/svelte/render.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/render.svelte
  • crates/biome_html_parser/tests/html_specs/error/svelte/html.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 : Unions of nodes must start with Any* (e.g., AnyHtmlAttribute)

Applied to files:

  • crates/biome_html_formatter/src/html/any/attribute.rs
  • xtask/codegen/html.ungram
📚 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/html/any/attribute.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/const_block.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/render_block.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/attach_attribute.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/html_block.rs
  • crates/biome_html_formatter/src/generated.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/html/any/attribute.rs
  • crates/biome_html_formatter/src/html/lists/attribute_list.rs
  • xtask/codegen/html.ungram
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_parser/src/syntax/svelte.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/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_formatter/src/html/any/attribute.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/const_block.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/render_block.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/attach_attribute.rs
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/html_block.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/lib.rs : Define the HtmlFormatter type alias: `type HtmlFormatter<'buf> = Formatter<'buf, HtmlFormatContext>;`

Applied to files:

  • crates/biome_html_formatter/src/html/any/attribute.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/const_block.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/render_block.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/attach_attribute.rs
  • crates/biome_html_parser/src/syntax/svelte.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/html_block.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/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/html/any/attribute.rs
  • crates/biome_html_formatter/src/svelte/any/block.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/const_block.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/render_block.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/attach_attribute.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/html_block.rs
  • crates/biome_html_formatter/src/generated.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_formatter/src/svelte/any/block.rs
  • crates/biome_html_parser/tests/spec_test.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/const_block.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_parser/src/syntax/svelte.rs
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/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_formatter/src/svelte/any/block.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/const_block.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/render_block.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/attach_attribute.rs
  • crates/biome_html_parser/src/lexer/tests.rs
  • crates/biome_html_parser/src/syntax/svelte.rs
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/html_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/svelte/any/block.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/attach_attribute.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/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/html_specs/error/svelte/attach.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/html.svelte
  • crates/biome_html_parser/tests/spec_test.rs
  • crates/biome_html_parser/tests/html_specs/ok/svelte/html.svelte
  • crates/biome_html_parser/tests/html_specs/error/svelte/render.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/const.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/const.svelte
  • crates/biome_html_parser/tests/html_specs/error/svelte/const.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/attach.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/render.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/attach.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/render.svelte
  • crates/biome_html_parser/tests/html_specs/error/svelte/html.svelte
📚 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/html_specs/error/svelte/attach.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/html.svelte
  • crates/biome_html_parser/tests/spec_test.rs
  • crates/biome_html_parser/tests/html_specs/ok/svelte/html.svelte
  • crates/biome_html_parser/tests/html_specs/error/svelte/render.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/const.svelte
  • crates/biome_html_parser/src/lexer/tests.rs
  • crates/biome_html_parser/tests/html_specs/ok/svelte/const.svelte
  • crates/biome_html_parser/tests/html_specs/error/svelte/const.svelte
  • crates/biome_html_formatter/src/svelte/auxiliary/mod.rs
  • crates/biome_html_formatter/tests/specs/html/svelte/render.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/attach.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/render.svelte
  • crates/biome_html_parser/tests/html_specs/error/svelte/html.svelte
📚 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/html_specs/error/svelte/attach.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/html.svelte
  • crates/biome_html_parser/tests/spec_test.rs
  • crates/biome_html_parser/tests/html_specs/ok/svelte/html.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/const.svelte
  • crates/biome_html_parser/tests/html_specs/error/svelte/const.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/render.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/render.svelte
  • crates/biome_html_parser/tests/html_specs/error/svelte/html.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/html_specs/error/svelte/attach.svelte
  • crates/biome_html_parser/tests/spec_test.rs
  • crates/biome_html_parser/tests/html_specs/error/svelte/const.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/render.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/render.svelte
  • crates/biome_html_parser/tests/html_specs/error/svelte/html.svelte
📚 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/html_specs/error/svelte/attach.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/html.svelte
  • crates/biome_html_parser/tests/spec_test.rs
  • crates/biome_html_formatter/tests/specs/html/svelte/render.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/render.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/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
  • crates/biome_html_parser/tests/html_specs/error/svelte/const.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
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_parser/src/syntax/svelte.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: Use p.eat for optional tokens, p.expect for required tokens; use .ok() for optional nodes and .or_add_diagnostic(...) for required nodes

Applied to files:

  • crates/biome_html_parser/src/syntax/parse_error.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_parser/src/syntax/svelte.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:

  • xtask/codegen/src/html_kinds_src.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/xtask/codegen/src/*_kinds_src.rs : Add src/<lang>_kinds_src.rs under xtask/codegen that returns a static KindSrc

Applied to files:

  • xtask/codegen/src/html_kinds_src.rs
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/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/html_kinds_src.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 : For non-mandatory tokens, use the provided helper constructors (e.g., `token`, `space_token`, `dynamic_token`)

Applied to files:

  • crates/biome_html_formatter/src/svelte/auxiliary/const_block.rs
  • crates/biome_html_parser/src/lexer/tests.rs
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/mod.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/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_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}/** : Create per-language crates biome_<lang>_syntax and biome_<lang>_factory under crates/

Applied to files:

  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_parser/src/syntax/svelte.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
  • crates/biome_html_parser/src/lexer/tests.rs
  • crates/biome_html_parser/src/syntax/svelte.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/comments.rs : Expose a public HtmlComments type alias: `pub type HtmlComments = Comments<HtmlLanguage>;`

Applied to files:

  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_parser/src/syntax/svelte.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: Parse rules should return ParsedSyntax; return Absent without consuming tokens when the node cannot be predicted

Applied to files:

  • crates/biome_html_parser/src/syntax/svelte.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/lexer/mod.rs
  • crates/biome_html_formatter/src/svelte/auxiliary/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
  • crates/biome_html_formatter/src/generated.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
📚 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
🧬 Code graph analysis (10)
crates/biome_html_parser/src/syntax/parse_error.rs (1)
crates/biome_parser/src/diagnostic.rs (1)
  • expected_node (481-483)
crates/biome_html_formatter/src/svelte/auxiliary/const_block.rs (4)
crates/biome_html_formatter/src/svelte/auxiliary/attach_attribute.rs (1)
  • fmt_fields (7-24)
crates/biome_html_formatter/src/svelte/auxiliary/html_block.rs (1)
  • fmt_fields (7-24)
crates/biome_html_formatter/src/svelte/auxiliary/render_block.rs (1)
  • fmt_fields (7-24)
crates/biome_html_syntax/src/generated/nodes.rs (21)
  • sv_curly_at_token (874-876)
  • sv_curly_at_token (924-926)
  • sv_curly_at_token (974-976)
  • sv_curly_at_token (1024-1026)
  • sv_curly_at_token (1249-1251)
  • const_token (927-929)
  • expression (441-443)
  • expression (726-728)
  • expression (880-882)
  • expression (930-932)
  • expression (1030-1032)
  • expression (1170-1172)
  • expression (1255-1257)
  • r_curly_token (729-731)
  • r_curly_token (883-885)
  • r_curly_token (933-935)
  • r_curly_token (983-985)
  • r_curly_token (1033-1035)
  • r_curly_token (1124-1126)
  • r_curly_token (1173-1175)
  • r_curly_token (1258-1260)
crates/biome_html_formatter/src/html/lists/attribute_list.rs (2)
crates/biome_html_formatter/src/generated.rs (16)
  • format (28-33)
  • format (66-71)
  • format (104-109)
  • format (142-144)
  • format (174-179)
  • format (212-217)
  • format (250-255)
  • format (288-293)
  • format (326-331)
  • format (364-370)
  • format (404-409)
  • format (442-447)
  • format (480-485)
  • format (512-517)
  • format (550-555)
  • format (588-594)
crates/biome_html_formatter/src/html/any/attribute.rs (1)
  • fmt (9-17)
crates/biome_html_formatter/src/svelte/auxiliary/render_block.rs (4)
crates/biome_html_formatter/src/svelte/auxiliary/attach_attribute.rs (1)
  • fmt_fields (7-24)
crates/biome_html_formatter/src/svelte/auxiliary/const_block.rs (1)
  • fmt_fields (7-24)
crates/biome_html_formatter/src/svelte/auxiliary/html_block.rs (1)
  • fmt_fields (7-24)
crates/biome_html_syntax/src/generated/nodes.rs (21)
  • sv_curly_at_token (874-876)
  • sv_curly_at_token (924-926)
  • sv_curly_at_token (974-976)
  • sv_curly_at_token (1024-1026)
  • sv_curly_at_token (1249-1251)
  • render_token (1252-1254)
  • expression (441-443)
  • expression (726-728)
  • expression (880-882)
  • expression (930-932)
  • expression (1030-1032)
  • expression (1170-1172)
  • expression (1255-1257)
  • r_curly_token (729-731)
  • r_curly_token (883-885)
  • r_curly_token (933-935)
  • r_curly_token (983-985)
  • r_curly_token (1033-1035)
  • r_curly_token (1124-1126)
  • r_curly_token (1173-1175)
  • r_curly_token (1258-1260)
crates/biome_html_parser/src/syntax/mod.rs (2)
crates/biome_html_parser/src/syntax/svelte.rs (3)
  • parse_attach_attribute (169-184)
  • parse_svelte_at_block (108-125)
  • parse_svelte_hash_block (20-27)
crates/biome_html_parser/src/syntax/parse_error.rs (3)
  • disabled_interpolation (12-14)
  • disabled_svelte_prop (16-18)
  • expected_closing_text_expression (20-33)
crates/biome_html_formatter/src/svelte/auxiliary/attach_attribute.rs (4)
crates/biome_html_formatter/src/svelte/auxiliary/const_block.rs (1)
  • fmt_fields (7-24)
crates/biome_html_formatter/src/svelte/auxiliary/html_block.rs (1)
  • fmt_fields (7-24)
crates/biome_html_formatter/src/svelte/auxiliary/render_block.rs (1)
  • fmt_fields (7-24)
crates/biome_html_syntax/src/generated/nodes.rs (21)
  • sv_curly_at_token (874-876)
  • sv_curly_at_token (924-926)
  • sv_curly_at_token (974-976)
  • sv_curly_at_token (1024-1026)
  • sv_curly_at_token (1249-1251)
  • attach_token (877-879)
  • expression (441-443)
  • expression (726-728)
  • expression (880-882)
  • expression (930-932)
  • expression (1030-1032)
  • expression (1170-1172)
  • expression (1255-1257)
  • r_curly_token (729-731)
  • r_curly_token (883-885)
  • r_curly_token (933-935)
  • r_curly_token (983-985)
  • r_curly_token (1033-1035)
  • r_curly_token (1124-1126)
  • r_curly_token (1173-1175)
  • r_curly_token (1258-1260)
crates/biome_html_parser/src/lexer/tests.rs (1)
crates/biome_html_parser/src/token_source.rs (1)
  • single_expression (59-61)
crates/biome_html_parser/src/syntax/svelte.rs (3)
crates/biome_html_parser/src/syntax/parse_error.rs (3)
  • expected_child (39-41)
  • expected_svelte_closing_block (100-102)
  • expected_text_expression (35-37)
crates/biome_html_parser/src/syntax/mod.rs (2)
  • parse_html_element (216-247)
  • new_single (558-562)
crates/biome_html_parser/src/token_source.rs (1)
  • single_expression (59-61)
crates/biome_html_formatter/src/svelte/auxiliary/html_block.rs (4)
crates/biome_html_formatter/src/svelte/auxiliary/attach_attribute.rs (1)
  • fmt_fields (7-24)
crates/biome_html_formatter/src/svelte/auxiliary/const_block.rs (1)
  • fmt_fields (7-24)
crates/biome_html_formatter/src/svelte/auxiliary/render_block.rs (1)
  • fmt_fields (7-24)
crates/biome_html_syntax/src/generated/nodes.rs (22)
  • sv_curly_at_token (874-876)
  • sv_curly_at_token (924-926)
  • sv_curly_at_token (974-976)
  • sv_curly_at_token (1024-1026)
  • sv_curly_at_token (1249-1251)
  • html_token (382-384)
  • html_token (1027-1029)
  • expression (441-443)
  • expression (726-728)
  • expression (880-882)
  • expression (930-932)
  • expression (1030-1032)
  • expression (1170-1172)
  • expression (1255-1257)
  • r_curly_token (729-731)
  • r_curly_token (883-885)
  • r_curly_token (933-935)
  • r_curly_token (983-985)
  • r_curly_token (1033-1035)
  • r_curly_token (1124-1126)
  • r_curly_token (1173-1175)
  • r_curly_token (1258-1260)
crates/biome_html_formatter/src/generated.rs (2)
crates/biome_html_syntax/src/file_source.rs (1)
  • svelte (96-100)
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/icy-planes-leave.md

[style] ~5-~5: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...rt Svelte syntax {@attach}. Biome now is able to parse and format the Svelte syntax [`{@...

(BE_ABLE_TO)

.changeset/all-tips-hang.md

[style] ~6-~6: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...port Svelte syntax {@html}. Biome now is able to parse and format the Svelte syntax [`{@...

(BE_ABLE_TO)

.changeset/mean-carrots-peel.md

[style] ~5-~5: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...ort Svelte syntax {@const}. Biome now is able to parse and format the Svelte syntax [`{@...

(BE_ABLE_TO)

.changeset/brown-poets-sit.md

[style] ~5-~5: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...rt Svelte syntax {@render}. Biome now is able to parse and format the Svelte syntax [`{@...

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

336-364: LGTM! Context change aligns with Svelte block parsing.

The shift from InsideTag to Regular context for Svelte opening tests correctly reflects that these constructs appear in regular HTML content rather than being confined to tag contexts.

crates/biome_html_parser/tests/html_specs/error/svelte/attach.svelte (1)

1-1: LGTM!

This error test case correctly exercises the parser's handling of a malformed {@attach} directive missing its expression.

crates/biome_html_parser/tests/html_specs/error/svelte/render.svelte (1)

1-1: LGTM!

This error test case correctly exercises the parser's handling of an unclosed {@render} block.

crates/biome_html_parser/tests/html_specs/error/svelte/const.svelte (1)

1-1: LGTM!

This error test case correctly exercises the parser's handling of an unclosed {@const} block.

crates/biome_html_parser/tests/html_specs/error/svelte/html.svelte (1)

1-1: LGTM!

This error test case correctly exercises the parser's handling of an unclosed {@html} block.

crates/biome_html_parser/src/syntax/parse_error.rs (1)

20-37: Well-structured refactoring.

The separation of concerns is spot on:

  • expected_closing_text_expression provides contextual diagnostics for unclosed expressions
  • expected_text_expression offers a simpler, general-purpose diagnostic for missing expressions

The implementation correctly delegates to expected_node, maintaining consistency with other diagnostic helpers in this file.

crates/biome_html_formatter/tests/specs/html/svelte/const.svelte (1)

1-1: Appropriate test fixture for {@const} directive.

The test case is minimal and suitable for validating const block parsing and formatting.

crates/biome_html_parser/tests/html_specs/ok/svelte/render.svelte (1)

1-1: Appropriate test fixture for {@render} directive.

The test case covers the render block parsing path.

crates/biome_html_formatter/src/html/lists/attribute_list.rs (1)

72-74: Proper integration of SvelteAttachAttribute.

The match arm follows the established pattern for attribute formatting.

crates/biome_html_formatter/src/svelte/any/block.rs (1)

12-16: Proper integration of new Svelte block variants.

The three new match arms follow the established formatting pattern consistently.

crates/biome_html_formatter/tests/specs/html/svelte/render.svelte (1)

1-1: Appropriate formatter test fixture for {@render} directive.

The test case validates render block formatting behaviour.

crates/biome_html_parser/tests/html_specs/ok/svelte/html.svelte (1)

1-5: Good test coverage for {@html} directive.

The test cases cover both standalone and inline usage patterns effectively.

crates/biome_html_formatter/src/html/any/attribute.rs (1)

15-15: Proper integration of SvelteAttachAttribute variant.

The match arm follows the established pattern for attribute formatting.

xtask/codegen/src/html_kinds_src.rs (1)

24-26: LGTM!

The new keywords and node kinds are consistent with the Svelte directives being added. Nicely aligned with the grammar definitions.

Also applies to: 68-71

crates/biome_html_parser/tests/html_specs/ok/svelte/attach.svelte (1)

1-16: LGTM!

Good test coverage for the {@attach} directive—simple, function call, and callback scenarios all represented.

crates/biome_html_parser/tests/html_specs/ok/svelte/const.svelte (1)

1-1: LGTM!

Simple and sufficient for exercising the {@const} parsing path.

crates/biome_html_formatter/tests/specs/html/svelte/html.svelte (1)

1-5: LGTM!

Test cases nicely cover dynamic and literal HTML injection scenarios for {@html}.

crates/biome_html_parser/tests/spec_test.rs (1)

145-145: LGTM!

Quick test now exercises the new {@html} directive parsing—good choice for a smoke test.

crates/biome_html_formatter/tests/specs/html/svelte/attach.svelte (1)

1-16: LGTM!

Formatter test cases mirror the parser tests appropriately—good consistency.

xtask/codegen/html.ungram (3)

165-165: LGTM!

Correctly adds SvelteAttachAttribute to the attribute union—this is the right place for it since it appears as an element attribute.


196-198: LGTM!

The new Svelte blocks are properly added to the union alongside existing blocks.


235-265: LGTM!

Grammar definitions for all four new Svelte directives are consistent and follow the established pattern. Clean and straightforward.

crates/biome_html_formatter/src/svelte/auxiliary/mod.rs (1)

1-11: LGTM!

Module declarations are correctly structured and follow the codebase pattern.

crates/biome_html_formatter/src/svelte/auxiliary/attach_attribute.rs (1)

1-25: LGTM!

The formatter implementation is consistent with the other Svelte block formatters and correctly orders tokens.

crates/biome_html_formatter/src/svelte/auxiliary/const_block.rs (1)

1-25: LGTM!

Implementation follows the established pattern for Svelte block formatters.

crates/biome_html_formatter/src/svelte/auxiliary/html_block.rs (1)

1-25: LGTM!

Formatter implementation is consistent with the established pattern.

crates/biome_html_formatter/src/svelte/auxiliary/render_block.rs (1)

1-25: LGTM!

Implementation follows the consistent pattern across all Svelte block formatters.

crates/biome_html_parser/src/syntax/mod.rs (3)

354-354: LGTM!

The feature-gated check for {@ tokens is correctly integrated.


488-544: LGTM!

The diagnostic function rename to expected_closing_text_expression with opening range context improves error reporting.


315-350: Asymmetry in attribute node wrapping confirmed—needs justification.

The T!["{{"] branch wraps its expression result in HTML_ATTRIBUTE, whilst T!['{'] and T!["{@"] return the expression node directly:

  • parse_double_text_expression completes as HTML_DOUBLE_TEXT_EXPRESSION → wrapped in HTML_ATTRIBUTE (line 326)
  • parse_single_text_expression completes as HTML_SINGLE_TEXT_EXPRESSION → returned directly (line 332)
  • parse_attach_attribute completes as SVELTE_ATTACH_ATTRIBUTE → returned directly (line 336)

Since parse_attribute is meant to parse attributes, all three should probably have consistent node wrapping. Either wrap all three or refactor the inner functions to handle wrapping themselves. Clarify the intended structure.

crates/biome_html_parser/src/lexer/mod.rs (1)

426-444: LGTM!

The Svelte keyword recognition logic correctly extends support for the new directives whilst preserving existing behaviour for {# and {/ contexts.

crates/biome_html_parser/src/syntax/svelte.rs (1)

169-184: LGTM!

The parse_attach_attribute function correctly differs from block parsers by managing its own marker and using HtmlLexContext::InsideTag for the closing brace, as it represents an attribute rather than a content block.

crates/biome_html_formatter/src/generated.rs (1)

719-756: LGTM – correctly generated formatter infrastructure.

The four new Svelte node types (SvelteAttachAttribute, SvelteConstBlock, SvelteHtmlBlock, SvelteRenderBlock) are properly integrated using the established FormatRule/AsFormat/IntoFormat pattern, consistent with existing implementations in this generated file.

Also applies to: 757-794, 833-870, 1019-1056

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@ematipico ematipico merged commit 96f3e77 into main Nov 6, 2025
14 checks passed
@ematipico ematipico deleted the feat/attach-html-render branch November 6, 2025 12:44
@github-actions github-actions bot mentioned this pull request Nov 6, 2025
ematipico added a commit to hamirmahal/biome that referenced this pull request Nov 19, 2025
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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 {@const} Implement svelte {@attach} Implement svelte {@html} Implement svelte {@render}

3 participants