-
-
Notifications
You must be signed in to change notification settings - Fork 713
feat(parser/html): text expressions in attributes #6907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 8a81ca7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
CodSpeed Performance ReportMerging #6907 will not alter performanceComparing Summary
Footnotes |
ffc9896
to
9108c28
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really need help getting #5356 to land before more things that affect HTML land.
278fcc3
to
16333d2
Compare
16333d2
to
5e91ac0
Compare
5e91ac0
to
ab153e3
Compare
ab153e3
to
76d7e0a
Compare
76d7e0a
to
3740f61
Compare
WalkthroughThis update introduces comprehensive support for interpolation syntax in HTML parsing, notably enabling double-brace expressions like Suggested labels
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (5)
crates/biome_html_parser/tests/html_specs/ok/multipe_expressions.vue (1)
1-3
: Filename typo – drop the “e”.
multipe_expressions.vue
is missing the second “l” in “multiple”. Renaming prevents head-scratching when someone hunts for the test later..changeset/brave-trees-push.md (1)
5-21
: Solid changeset documentation with minor style tweak.The experimental nature is well highlighted and the examples are clear. Consider "allows parsing of .html files" instead of "allows to parse .html files" for more natural phrasing.
-Added a new **experimental option** that allows to parse `.html` files that contain interpolation syntax. +Added a new **experimental option** that allows parsing of `.html` files that contain interpolation syntax.crates/biome_html_parser/src/lib.rs (1)
36-36
: Complete or remove the incomplete documentation.This orphaned
///
comment should either be expanded with proper documentation for theparse_html
function or removed entirely.-/// pub fn parse_html(source: &str, options: HtmlParseOptions) -> HtmlParse {
crates/biome_html_parser/src/lexer/mod.rs (2)
636-726
: Comprehensive text parsing with escape handling.The refactored method properly handles both double-brace expressions and escaped characters. Consider extracting the escape logic into a helper method if this grows further.
204-243
: Consider adding rustdoc comments.The new text expression methods would benefit from documentation explaining the difference between single and double expressions and their use cases.
Docstrings generation was requested by @ematipico. * #6907 (comment) The following files were modified: * `crates/biome_cli/tests/cases/html.rs` * `crates/biome_html_formatter/benches/html_formatter.rs` * `crates/biome_html_formatter/src/astro/auxiliary/expression.rs` * `crates/biome_html_formatter/src/generated.rs` * `crates/biome_html_formatter/src/html/any/attribute.rs` * `crates/biome_html_formatter/src/html/any/attribute_initializer.rs` * `crates/biome_html_formatter/src/html/any/text_expression.rs` * `crates/biome_html_formatter/src/html/auxiliary/double_text_expression.rs` * `crates/biome_html_formatter/src/html/auxiliary/single_text_expression.rs` * `crates/biome_html_formatter/src/html/auxiliary/text_expression.rs` * `crates/biome_html_formatter/src/html/lists/attribute_list.rs` * `crates/biome_html_formatter/tests/language.rs` * `crates/biome_html_parser/benches/html_parser.rs` * `crates/biome_html_parser/src/lexer/mod.rs` * `crates/biome_html_parser/src/lib.rs` * `crates/biome_html_parser/src/parser.rs` * `crates/biome_html_parser/src/syntax/mod.rs` * `crates/biome_html_parser/src/syntax/parse_error.rs` * `crates/biome_html_syntax/src/file_source.rs` * `crates/biome_html_syntax/src/lib.rs` * `crates/biome_parser/src/lib.rs` * `crates/biome_service/src/file_handlers/html.rs` * `crates/biome_service/src/settings.rs`
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
♻️ Duplicate comments (2)
crates/biome_html_parser/src/parser.rs (1)
99-110
: Enum duplication echoes earlier issueAnother private
TextExpressionKind
appears here, separate from the one intoken_source.rs
. Unifying them will avoid transmute-style casts later.crates/biome_html_parser/src/lexer/mod.rs (1)
224-240
: Single-brace scan has same nesting caveatSame early-cut limitation as above – worth fixing in tandem.
🧹 Nitpick comments (3)
crates/biome_html_parser/src/token_source.rs (1)
131-145
: Checkpoint rewind lacks invariant comments
rewind
truncatestrivia_list
without restoring invariants on the trailing flag; future readers might wonder why this is safe. A brief comment would prevent head-scratching.crates/biome_html_parser/src/parser.rs (1)
128-155
:From<HtmlFileSource>
exhaustivenessIf a new
HtmlVariant
is added later thismatch
will silently compile with a wildcard arm. Add an explicit_ => unreachable!()
or a compile-time exhaustive pattern to surface future misses.crates/biome_html_parser/src/lexer/mod.rs (1)
547-553
: Utility helpers could beconst fn
Both brace-detection helpers are pure byte checks – mark them
#[inline(always)] const
for zero-cost in hot paths.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
crates/biome_html_parser/tests/html_specs/error/astro/attribute_expression.astro.snap
is excluded by!**/*.snap
crates/biome_html_parser/tests/html_specs/error/vue_unclosed_expression.vue.snap
is excluded by!**/*.snap
crates/biome_html_parser/tests/html_specs/ok/interpolation.vue.snap
is excluded by!**/*.snap
📒 Files selected for processing (5)
crates/biome_html_parser/src/lexer/mod.rs
(10 hunks)crates/biome_html_parser/src/parser.rs
(3 hunks)crates/biome_html_parser/src/syntax/mod.rs
(9 hunks)crates/biome_html_parser/src/token_source.rs
(6 hunks)crates/biome_html_parser/tests/html_specs/ok/interpolation.vue
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/biome_html_parser/src/syntax/mod.rs
🧰 Additional context used
📓 Path-based instructions (3)
crates/biome_*/**/*
📄 CodeRabbit Inference Engine (CLAUDE.md)
Core crates must be located in
/crates/biome_*/
Files:
crates/biome_html_parser/tests/html_specs/ok/interpolation.vue
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/parser.rs
crates/biome_html_parser/src/token_source.rs
**/*.{rs,toml}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Format code (Rust + TOML) using
just format
Format Rust and TOML files using
just f
(alias forjust format
).
Files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/parser.rs
crates/biome_html_parser/src/token_source.rs
**/*.rs
📄 CodeRabbit Inference Engine (CONTRIBUTING.md)
Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/parser.rs
crates/biome_html_parser/src/token_source.rs
🧠 Learnings (29)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: Applies to **/*.rs : Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/cst.rs : Define the `FormatHtmlSyntaxNode` type inside a file called `cst.rs` and implement the required formatting traits and plumbing for CST formatting.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Implement the `HtmlTestFormatLanguage` struct and the `TestFormatLanguage` trait in `language.rs` for test language support.
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/specs/html/**/*.html : Create your first `.html` test file inside `tests/specs/html`, preferably organizing tests into subfolders by kind.
Applied to files:
crates/biome_html_parser/tests/html_specs/ok/interpolation.vue
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/spec_tests.rs : Update the `spec_tests.rs` file to generate a test function for each `.html` file found inside `tests/specs/html` using the `tests_macros::gen_tests!` macro.
Applied to files:
crates/biome_html_parser/tests/html_specs/ok/interpolation.vue
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/parser.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Implement the `HtmlTestFormatLanguage` struct and the `TestFormatLanguage` trait in `language.rs` for test language support.
Applied to files:
crates/biome_html_parser/tests/html_specs/ok/interpolation.vue
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/parser.rs
crates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/{spec_test.rs,spec_tests.rs,language.rs} : Inside the `biome_html_formatter` crate, create a `tests` folder containing a `specs` folder and the files `spec_test.rs`, `spec_tests.rs`, and `language.rs` for test infrastructure.
Applied to files:
crates/biome_html_parser/tests/html_specs/ok/interpolation.vue
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/tests/specs/*/*/*.jsonc : Files ending with `.jsonc` in snapshot tests should contain arrays of code snippets for script environments.
Applied to files:
crates/biome_html_parser/tests/html_specs/ok/interpolation.vue
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/token_source*.rs : Implement a token source as a thin layer wrapping the lexer, supporting lookahead, re-lexing, and checkpoint features.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/parser.rs
crates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/lexer/mod.rs : Implement the `Lexer` trait from the `biome_parser` crate for your language-specific lexer struct.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/lexer/mod.rs : Create a `lexer/mod.rs` file inside the parser crate for each language to implement the lexer.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, if a token is mandatory and the AST has that information, use the token from the AST node (e.g., `node.l_paren_token().format()`) instead of hardcoding the token (e.g., `token("(")`).
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/**/language_kind.rs : Add a new variant to `LanguageKind` in `language_kind.rs` for each new language, and implement all required methods for the new variant.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/context.rs : Define the `HtmlFormatContext` type inside a file called `context.rs`, including `comments` and `source_map` fields, and implement the `FormatContext` and `CstFormatContext` traits.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/parser.rs
crates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/**/language_kind.rs : Add a new prefix (e.g., `html_`) to `LANGUAGE_PREFIXES` in `language_kind.rs` for each new language.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Use conditional syntax handling to add diagnostics if a syntax is not supported in the current file or context, and wrap invalid syntax in a `BOGUS` node if necessary.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use the provided helper functions when formatting AST nodes.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/parser.rs
crates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-08-05T13:25:32.395Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-05T13:25:32.395Z
Learning: Applies to benches/html_formatter.rs : Benchmark for HTML formatter must be in `benches/html_formatter.rs`
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/parser.rs
crates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/cst.rs : Define the `FormatHtmlSyntaxNode` type inside a file called `cst.rs` and implement the required formatting traits and plumbing for CST formatting.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/parser.rs
crates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Nodes for enclosing syntax errors must have the word `Bogus` in their name (e.g., `HtmlBogusAttribute`).
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/comments.rs : Define the `HtmlCommentStyle` type (as `HtmlComments`) inside a file called `comments.rs` and ensure it implements the `CommentStyle` trait.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/parser.rs
crates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Implement the `FormatLanguage` trait for the `HtmlFormatLanguage` type.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/src/*_kinds_src.rs : Create a new file called `src/<lang>_kinds_src.rs` for each language, which must return a static `KindSrc`.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/parser*.rs : Implement the `Parser` trait for your language-specific parser struct.
Applied to files:
crates/biome_html_parser/src/parser.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Parse rule functions should take a `&mut` reference to the parser as their only parameter and return a `ParsedSyntax`.
Applied to files:
crates/biome_html_parser/src/parser.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Rule options must be documented in the `## Options` section of the rule's documentation, with each option having its own header and example.
Applied to files:
crates/biome_html_parser/src/parser.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code when formatting AST nodes. If a mandatory token or node is missing, return `None` instead.
Applied to files:
crates/biome_html_parser/src/parser.rs
crates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Create a type alias `HtmlFormatter<'buf>` as `Formatter<'buf, HtmlFormatContext>`.
Applied to files:
crates/biome_html_parser/src/parser.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : When parsing lists, perform error recovery to avoid infinite loops, using the provided parser infrastructure.
Applied to files:
crates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Each code block in rule documentation must specify a language and use `expect_diagnostic` for invalid examples.
Applied to files:
crates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Consult the grammar to identify the appropriate `BOGUS` node for error recovery in your parse rule.
Applied to files:
crates/biome_html_parser/src/token_source.rs
⏰ 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). (23)
- GitHub Check: Parser conformance
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_html_formatter)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Documentation
- GitHub Check: Bench (biome_html_parser)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Check JS Files
- GitHub Check: Check Dependencies
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test Node.js API
- GitHub Check: autofix
🔇 Additional comments (2)
crates/biome_html_parser/tests/html_specs/ok/interpolation.vue (1)
1-13
: Looks good – test file approvedThe fixture exercises both simple and compound interpolations; no red flags.
crates/biome_html_parser/src/lexer/mod.rs (1)
492-502
: Token kinds{{
/}}
must existEnsure
T!["{{"]
andT!["}}"]
are defined in the generated kinds; otherwise formatter parity and diagnostics will blow up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
crates/biome_html_parser/src/lexer/mod.rs (1)
224-240
: Single-brace scanner mirrors the same limitationThe single-brace variant has identical early-exit behaviour. Re-use a shared brace-aware routine to avoid duplication and fix both paths in one hit.
🧹 Nitpick comments (1)
crates/biome_html_parser/src/lexer/mod.rs (1)
62-75
: Minor: lots of repeated brace checksThe
{
/}
branching logic is duplicated across three contexts. Once the scanners above are refactored, consider funnelling all brace handling through them to keep the lexing surface small.Also applies to: 104-117, 636-726
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
crates/biome_html_parser/tests/html_specs/ok/interpolation.vue.snap
is excluded by!**/*.snap
📒 Files selected for processing (3)
crates/biome_html_parser/src/lexer/mod.rs
(10 hunks)crates/biome_html_parser/src/parser.rs
(3 hunks)crates/biome_html_parser/tests/html_specs/ok/interpolation.vue
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- crates/biome_html_parser/tests/html_specs/ok/interpolation.vue
- crates/biome_html_parser/src/parser.rs
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{rs,toml}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Format code (Rust + TOML) using
just format
Format Rust and TOML files using
just f
(alias forjust format
).
Files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_*/**/*
📄 CodeRabbit Inference Engine (CLAUDE.md)
Core crates must be located in
/crates/biome_*/
Files:
crates/biome_html_parser/src/lexer/mod.rs
**/*.rs
📄 CodeRabbit Inference Engine (CONTRIBUTING.md)
Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Files:
crates/biome_html_parser/src/lexer/mod.rs
🧠 Learnings (24)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: Applies to **/*.rs : Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/cst.rs : Define the `FormatHtmlSyntaxNode` type inside a file called `cst.rs` and implement the required formatting traits and plumbing for CST formatting.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Implement the `HtmlTestFormatLanguage` struct and the `TestFormatLanguage` trait in `language.rs` for test language support.
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/lexer/mod.rs : Implement the `Lexer` trait from the `biome_parser` crate for your language-specific lexer struct.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/token_source*.rs : Implement a token source as a thin layer wrapping the lexer, supporting lookahead, re-lexing, and checkpoint features.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/lexer/mod.rs : Create a `lexer/mod.rs` file inside the parser crate for each language to implement the lexer.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/context.rs : Define the `HtmlFormatContext` type inside a file called `context.rs`, including `comments` and `source_map` fields, and implement the `FormatContext` and `CstFormatContext` traits.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, if a token is mandatory and the AST has that information, use the token from the AST node (e.g., `node.l_paren_token().format()`) instead of hardcoding the token (e.g., `token("(")`).
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/**/language_kind.rs : Add a new prefix (e.g., `html_`) to `LANGUAGE_PREFIXES` in `language_kind.rs` for each new language.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Use conditional syntax handling to add diagnostics if a syntax is not supported in the current file or context, and wrap invalid syntax in a `BOGUS` node if necessary.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/**/language_kind.rs : Add a new variant to `LanguageKind` in `language_kind.rs` for each new language, and implement all required methods for the new variant.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Implement the `HtmlTestFormatLanguage` struct and the `TestFormatLanguage` trait in `language.rs` for test language support.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:49:35.574Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: Applies to **/*.rs : Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code when formatting AST nodes. If a mandatory token or node is missing, return `None` instead.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use the provided helper functions when formatting AST nodes.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : When parsing lists, perform error recovery to avoid infinite loops, using the provided parser infrastructure.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Avoid deep indentation by using combinators like `map`, `filter`, and `and_then` instead of nested `if let` or `match` statements.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Avoid unnecessary string allocations by comparing against `&str` or `TokenText` instead of calling `to_string()`.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Nodes for enclosing syntax errors must have the word `Bogus` in their name (e.g., `HtmlBogusAttribute`).
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Consult the grammar to identify the appropriate `BOGUS` node for error recovery in your parse rule.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T13:25:32.395Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-05T13:25:32.395Z
Learning: Applies to benches/html_formatter.rs : Benchmark for HTML formatter must be in `benches/html_formatter.rs`
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/spec_tests.rs : Update the `spec_tests.rs` file to generate a test function for each `.html` file found inside `tests/specs/html` using the `tests_macros::gen_tests!` macro.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/cst.rs : Define the `FormatHtmlSyntaxNode` type inside a file called `cst.rs` and implement the required formatting traits and plumbing for CST formatting.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/comments.rs : Define the `HtmlCommentStyle` type (as `HtmlComments`) inside a file called `comments.rs` and ensure it implements the `CommentStyle` trait.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Implement the `FormatLanguage` trait for the `HtmlFormatLanguage` type.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/src/*_kinds_src.rs : Create a new file called `src/<lang>_kinds_src.rs` for each language, which must return a static `KindSrc`.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
🪛 GitHub Actions: Pull request
crates/biome_html_parser/src/lexer/mod.rs
[error] 536-536: Cannot call non-const method <HtmlLexer as Lexer>::current_byte
in constant functions; also PartialEq
is not stable as const trait.
[error] 537-537: Cannot call non-const method <HtmlLexer as Lexer>::byte_at
in constant functions; also PartialEq
is not stable as const trait.
[error] 542-542: Cannot call non-const method <HtmlLexer as Lexer>::current_byte
in constant functions; also PartialEq
is not stable as const trait.
[error] 543-543: Cannot call non-const method <HtmlLexer as Lexer>::byte_at
in constant functions; also PartialEq
is not stable as const trait.
[error] 544-544: Cannot call non-const method <HtmlLexer as Lexer>::byte_at
in constant functions; also PartialEq
is not stable as const trait.
[error] 549-549: Cannot call non-const method <HtmlLexer as Lexer>::current_byte
and <HtmlLexer as Lexer>::byte_at
in constant functions; also PartialEq
is not stable as const trait.
[error] 554-554: Cannot call non-const method <HtmlLexer as Lexer>::current_byte
and <HtmlLexer as Lexer>::byte_at
in constant functions; also PartialEq
is not stable as const trait.
🪛 GitHub Actions: autofix.ci
crates/biome_html_parser/src/lexer/mod.rs
[error] 536-538: Cannot call non-const methods current_byte
and byte_at
in constant functions. Calls in constant functions are limited to const functions, tuple structs, and tuple variants.
[error] 542-544: Cannot call non-const methods current_byte
and byte_at
in constant functions. Calls in constant functions are limited to const functions, tuple structs, and tuple variants.
[error] 549-554: Cannot call non-const methods current_byte
and byte_at
in constant functions. Calls in constant functions are limited to const functions, tuple structs, and tuple variants.
⏰ 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). (18)
- GitHub Check: Test Node.js API
- GitHub Check: Check JS Files
- GitHub Check: Bench (biome_html_parser)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_html_formatter)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Parser conformance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
crates/biome_html_parser/src/syntax/mod.rs (1)
287-316
: Single-brace attributes are parsed but never consumed
is_at_attribute_start
now returnstrue
on a solitary{
, yetparse_attribute
has no dedicated branch for that case –parse_literal
bails out, no token is eaten, and the loop spins forever on the same{
.Either handle the spread-like construct explicitly or drop
{
fromis_at_attribute_start
for now:if p.at(T!["{{"]) { /* unchanged */ + } else if p.at(T!['{']) { + HtmlSyntaxFeatures::SingleTextExpressions + .parse_exclusive_syntax( + p, + |p| parse_single_text_expression(p, HtmlLexContext::InsideTag), + |p, m| disabled_interpolation(p, m.range(p)), + ) + .ok(); + Present(m.complete(p, HTML_ATTRIBUTE)) } else {
♻️ Duplicate comments (1)
crates/biome_html_parser/src/lexer/mod.rs (1)
204-222
: Double-brace scan still naïve – already flagged earlier, still applies.
Nested braces/string literals break the lexer.
🧹 Nitpick comments (1)
crates/biome_html_parser/src/lexer/mod.rs (1)
534-555
: Unnecessary&mut self
in predicate helpers
at_end_cdata
,is_at_frontmatter_edge
,is_at_opening/closing_double_text_expression
don’t mutate state – a shared reference is enough and conveys intent:-fn at_end_cdata(&mut self) -> bool { +fn at_end_cdata(&self) -> bool {Same for the three other helpers above.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
crates/biome_html_parser/src/lexer/mod.rs
(10 hunks)crates/biome_html_parser/src/parser.rs
(3 hunks)crates/biome_html_parser/src/syntax/mod.rs
(9 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/biome_html_parser/src/parser.rs
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{rs,toml}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Format code (Rust + TOML) using
just format
Format Rust and TOML files using
just f
(alias forjust format
).
Files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/syntax/mod.rs
crates/biome_*/**/*
📄 CodeRabbit Inference Engine (CLAUDE.md)
Core crates must be located in
/crates/biome_*/
Files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/syntax/mod.rs
**/*.rs
📄 CodeRabbit Inference Engine (CONTRIBUTING.md)
Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/syntax/mod.rs
🧠 Learnings (32)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: Applies to **/*.rs : Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/cst.rs : Define the `FormatHtmlSyntaxNode` type inside a file called `cst.rs` and implement the required formatting traits and plumbing for CST formatting.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Implement the `HtmlTestFormatLanguage` struct and the `TestFormatLanguage` trait in `language.rs` for test language support.
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/token_source*.rs : Implement a token source as a thin layer wrapping the lexer, supporting lookahead, re-lexing, and checkpoint features.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/lexer/mod.rs : Implement the `Lexer` trait from the `biome_parser` crate for your language-specific lexer struct.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/lexer/mod.rs : Create a `lexer/mod.rs` file inside the parser crate for each language to implement the lexer.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, if a token is mandatory and the AST has that information, use the token from the AST node (e.g., `node.l_paren_token().format()`) instead of hardcoding the token (e.g., `token("(")`).
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:49:35.574Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: Applies to **/*.rs : Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/context.rs : Define the `HtmlFormatContext` type inside a file called `context.rs`, including `comments` and `source_map` fields, and implement the `FormatContext` and `CstFormatContext` traits.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/**/language_kind.rs : Add a new prefix (e.g., `html_`) to `LANGUAGE_PREFIXES` in `language_kind.rs` for each new language.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Use conditional syntax handling to add diagnostics if a syntax is not supported in the current file or context, and wrap invalid syntax in a `BOGUS` node if necessary.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Implement the `HtmlTestFormatLanguage` struct and the `TestFormatLanguage` trait in `language.rs` for test language support.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use the provided helper functions when formatting AST nodes.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Avoid unnecessary string allocations by comparing against `&str` or `TokenText` instead of calling `to_string()`.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Avoid deep indentation by using combinators like `map`, `filter`, and `and_then` instead of nested `if let` or `match` statements.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code when formatting AST nodes. If a mandatory token or node is missing, return `None` instead.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:50:35.163Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:35.163Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Prefer showing a rich advice like a code frame, diff, or command to a textual explanation when possible, as these are generally easier to understand and provide additional context.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Each code block in rule documentation must specify a language and use `expect_diagnostic` for invalid examples.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : When parsing lists, perform error recovery to avoid infinite loops, using the provided parser infrastructure.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : When banning certain functions or variables, always check if the variable is global using the semantic model to avoid false positives.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T13:25:32.395Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-05T13:25:32.395Z
Learning: Applies to benches/html_formatter.rs : Benchmark for HTML formatter must be in `benches/html_formatter.rs`
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/no_constant*_*.rs : Rules that report computations always evaluated to the same value should use the `noConstant<Concept>` naming convention (e.g., `noConstantMathMinMaxClamp`).
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/cst.rs : Define the `FormatHtmlSyntaxNode` type inside a file called `cst.rs` and implement the required formatting traits and plumbing for CST formatting.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Nodes for enclosing syntax errors must have the word `Bogus` in their name (e.g., `HtmlBogusAttribute`).
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/spec_tests.rs : Update the `spec_tests.rs` file to generate a test function for each `.html` file found inside `tests/specs/html` using the `tests_macros::gen_tests!` macro.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/comments.rs : Define the `HtmlCommentStyle` type (as `HtmlComments`) inside a file called `comments.rs` and ensure it implements the `CommentStyle` trait.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Implement the `FormatLanguage` trait for the `HtmlFormatLanguage` type.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/src/*_kinds_src.rs : Create a new file called `src/<lang>_kinds_src.rs` for each language, which must return a static `KindSrc`.
Applied to files:
crates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Parse rule functions should take a `&mut` reference to the parser as their only parameter and return a `ParsedSyntax`.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Consult the grammar to identify the appropriate `BOGUS` node for error recovery in your parse rule.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Nodes that represent a list must end with the postfix `List` (e.g., `HtmlAttributeList`).
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Parse rule functions must return `Present` if they consume any token and can parse the node with at least some children, and return `Absent` otherwise without progressing the parser or adding errors.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/parser*.rs : Implement the `Parser` trait for your language-specific parser struct.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : All grammar nodes must start with the prefix of the language (e.g., `HtmlSimpleAttribute`).
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
⏰ 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). (26)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_html_parser)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_html_formatter)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Check JS Files
- GitHub Check: Test Node.js API
- GitHub Check: autofix
- GitHub Check: Documentation
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Check Dependencies
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Parser conformance
🔇 Additional comments (1)
crates/biome_html_parser/src/syntax/mod.rs (1)
540-572
:TextExpression::parse_element
stops at first tokenThe helper eats exactly one token per call. That’s fine once it’s invoked in a loop (see previous comment), but by itself it cannot parse strings, numbers, operators, etc. Ensure the callers iterate or redesign this helper to ― well ― parse an expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
crates/biome_html_parser/src/syntax/mod.rs (1)
446-448
: Still parses only the first inner token
parse_double_text_expression
andparse_single_text_expression
callTextExpression::parse_element
once, so{{ a + b }}
or{ a + b }
stop ata
, leaving the parser stuck on+ b …
.- TextExpression::new_double().parse_element(p).ok(); + while TextExpression::new_double().parse_element(p).is_present() {} ... - TextExpression::new_single().parse_element(p).ok(); + while TextExpression::new_single().parse_element(p).is_present() {}Without the loop complex expressions break parsing and can trigger infinite-loops in recovery.
Same issue was flagged earlier but is still present.Also applies to: 496-498
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
crates/biome_html_parser/src/lexer/mod.rs
(12 hunks)crates/biome_html_parser/src/syntax/mod.rs
(9 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/biome_html_parser/src/lexer/mod.rs
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{rs,toml}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Format code (Rust + TOML) using
just format
Format Rust and TOML files using
just f
(alias forjust format
).
Files:
crates/biome_html_parser/src/syntax/mod.rs
crates/biome_*/**/*
📄 CodeRabbit Inference Engine (CLAUDE.md)
Core crates must be located in
/crates/biome_*/
Files:
crates/biome_html_parser/src/syntax/mod.rs
**/*.rs
📄 CodeRabbit Inference Engine (CONTRIBUTING.md)
Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Files:
crates/biome_html_parser/src/syntax/mod.rs
🧠 Learnings (23)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: For other documentation updates (e.g., new formatter options), create a PR against the `next` branch of the website repository.
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: Applies to **/*.rs : Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/cst.rs : Define the `FormatHtmlSyntaxNode` type inside a file called `cst.rs` and implement the required formatting traits and plumbing for CST formatting.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Implement the `HtmlTestFormatLanguage` struct and the `TestFormatLanguage` trait in `language.rs` for test language support.
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, if a token is mandatory and the AST has that information, use the token from the AST node (e.g., `node.l_paren_token().format()`) instead of hardcoding the token (e.g., `token("(")`).
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Use conditional syntax handling to add diagnostics if a syntax is not supported in the current file or context, and wrap invalid syntax in a `BOGUS` node if necessary.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/cst.rs : Define the `FormatHtmlSyntaxNode` type inside a file called `cst.rs` and implement the required formatting traits and plumbing for CST formatting.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use the provided helper functions when formatting AST nodes.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Parse rule functions should take a `&mut` reference to the parser as their only parameter and return a `ParsedSyntax`.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:05.640Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:05.640Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code when formatting AST nodes. If a mandatory token or node is missing, return `None` instead.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/token_source*.rs : Implement a token source as a thin layer wrapping the lexer, supporting lookahead, re-lexing, and checkpoint features.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Implement the `HtmlTestFormatLanguage` struct and the `TestFormatLanguage` trait in `language.rs` for test language support.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:49:35.574Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:49:35.574Z
Learning: Applies to **/*.rs : Update documentation for new features or changes, using inline rustdoc for rules, assists, and their options.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/context.rs : Define the `HtmlFormatContext` type inside a file called `context.rs`, including `comments` and `source_map` fields, and implement the `FormatContext` and `CstFormatContext` traits.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Each code block in rule documentation must specify a language and use `expect_diagnostic` for invalid examples.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Nodes for enclosing syntax errors must have the word `Bogus` in their name (e.g., `HtmlBogusAttribute`).
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : When parsing lists, perform error recovery to avoid infinite loops, using the provided parser infrastructure.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Consult the grammar to identify the appropriate `BOGUS` node for error recovery in your parse rule.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Nodes that represent a list must end with the postfix `List` (e.g., `HtmlAttributeList`).
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Parse rule functions must return `Present` if they consume any token and can parse the node with at least some children, and return `Absent` otherwise without progressing the parser or adding errors.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/*.rs : Parse rule functions must be prefixed with `parse_` and use the name defined in the grammar file (e.g., `parse_for_statement`).
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:50:18.454Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: Applies to crates/biome_analyze/biome_*/lib/src/lint/nursery/*.rs : Avoid unnecessary string allocations by comparing against `&str` or `TokenText` instead of calling `to_string()`.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/crates/biome_*/**/parser*.rs : Implement the `Parser` trait for your language-specific parser struct.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:50:56.365Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/**/comments.rs : Define the `HtmlCommentStyle` type (as `HtmlComments`) inside a file called `comments.rs` and ensure it implements the `CommentStyle` trait.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T14:51:51.355Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:51.355Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : All grammar nodes must start with the prefix of the language (e.g., `HtmlSimpleAttribute`).
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-08-05T13:25:32.395Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-05T13:25:32.395Z
Learning: Applies to benches/html_formatter.rs : Benchmark for HTML formatter must be in `benches/html_formatter.rs`
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
⏰ 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). (26)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_html_parser)
- GitHub Check: Bench (biome_html_formatter)
- GitHub Check: Documentation
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Test Node.js API
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Parser conformance
- GitHub Check: Check JS Files
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: autofix
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: dyc3 <1808807+dyc3@users.noreply.github.com>
Summary
This PR implements the parsing of single text expressions:
{ expr }
.I implemented some refactors, so the parsing of double expressions and single text expressions is more or less the same.
A new
HtmlParseOptions
type has been introduced, which exposes options for passing text expressions and the frontmatter. The options are set usingFrom<HtmlFileSource> for HtmlParseOptions
. This approach in line with what we do across the project.Text expressions are formatted verbatim for now, so they are currently marked as unimplemented.
This is potentially a breaking change for users who have
.html
files that use{{ }}
, because the parser now introduces a parsing error. In this PR, we introduce a new parsing option, which is released as experimental (the whole parser is experimental, so it's safe to assume that even the option is). By enabling this option, users can turn off the erros.Test Plan
Added new tests and updated the current ones
Docs
biomejs/website#2875