-
-
Notifications
You must be signed in to change notification settings - Fork 781
feat(parse/html): support vue directive syntax #7673
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: 85f4df9 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 |
WalkthroughAdds Vue directive support across the HTML pipeline: new grammar nodes (Vue directives, arguments, modifiers, bogus variants) and token kinds; a Vue-aware lexing context (InsideTagVue) and lexer extensions; a parser flag HtmlParseOptions.vue and parser routines for v-bind/:, v-on/@ shorthands, modifiers and directive arguments; formatter wiring and FormatRule implementations for Vue AST nodes; generated-code updates; and many new Vue-focused parser/formatter tests. Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
4485ec0 to
0fba4d9
Compare
|
|
||
| // <div @click="onClick" /> | ||
| // ^^^^^^^^^^^^^^^^ | ||
| VueVOnShorthandDirective = |
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.
Where there's a VOn in the name?
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.
@click is shorthand for v-on:click
|
BTW I fixed the failing test in another branch, so we can ignore it |
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: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/biome_html_parser/src/syntax/mod.rs (1)
340-363: Kill the duplicate{{arm before it kills the buildRust refuses to match on
T!["{{"]twice; this duplicated arm makes the whole crate un-compilable. Please drop the extra branch so the match stays unique.- T!["{{"] => { - let m = p.start(); - DoubleTextExpressions - .parse_exclusive_syntax( - p, - |p| parse_double_text_expression(p, HtmlLexContext::InsideTag), - |p, marker| disabled_interpolation(p, marker.range(p)), - ) - .ok(); - Present(m.complete(p, HTML_ATTRIBUTE)) - } T!["{{"] => { let m = p.start(); HtmlSyntaxFeatures::DoubleTextExpressions .parse_exclusive_syntax( p,
🧹 Nitpick comments (1)
.changeset/shy-flowers-decide.md (1)
5-5: Consider simplifying the phrasing.The static analyser suggests "can now" as a more concise alternative to "is now able to".
Apply this diff:
-The HTML parser is now able to parse vue directives. This enables us to write/port Vue lint rules that require inspecting the `<template>` section. +The HTML parser can now parse vue directives. This enables us to write/port Vue lint rules that require inspecting the `<template>` section.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (11)
crates/biome_html_factory/src/generated/node_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_html_factory/src/generated/syntax_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_html_parser/tests/html_specs/ok/vue/modifier.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/modifiers-all-variants.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-bind-shorthand.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-bind.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-on-shorthand.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_syntax/src/generated/kind.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_html_syntax/src/generated/macros.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_html_syntax/src/generated/nodes.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_html_syntax/src/generated/nodes_mut.rsis excluded by!**/generated/**,!**/generated/**and included by**
📒 Files selected for processing (37)
.changeset/shy-flowers-decide.md(1 hunks)crates/biome_html_formatter/src/generated.rs(4 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/lib.rs(1 hunks)crates/biome_html_formatter/src/vue/any/directive.rs(1 hunks)crates/biome_html_formatter/src/vue/any/directive_argument.rs(1 hunks)crates/biome_html_formatter/src/vue/any/mod.rs(1 hunks)crates/biome_html_formatter/src/vue/auxiliary/directive.rs(1 hunks)crates/biome_html_formatter/src/vue/auxiliary/directive_argument.rs(1 hunks)crates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rs(1 hunks)crates/biome_html_formatter/src/vue/auxiliary/mod.rs(1 hunks)crates/biome_html_formatter/src/vue/auxiliary/modifier.rs(1 hunks)crates/biome_html_formatter/src/vue/auxiliary/static_argument.rs(1 hunks)crates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rs(1 hunks)crates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.rs(1 hunks)crates/biome_html_formatter/src/vue/bogus/bogus_directive.rs(1 hunks)crates/biome_html_formatter/src/vue/bogus/bogus_directive_argument.rs(1 hunks)crates/biome_html_formatter/src/vue/bogus/mod.rs(1 hunks)crates/biome_html_formatter/src/vue/lists/mod.rs(1 hunks)crates/biome_html_formatter/src/vue/lists/modifier_list.rs(1 hunks)crates/biome_html_formatter/src/vue/mod.rs(1 hunks)crates/biome_html_parser/src/lexer/mod.rs(5 hunks)crates/biome_html_parser/src/parser.rs(3 hunks)crates/biome_html_parser/src/syntax/mod.rs(15 hunks)crates/biome_html_parser/src/syntax/parse_error.rs(1 hunks)crates/biome_html_parser/src/syntax/vue.rs(1 hunks)crates/biome_html_parser/src/token_source.rs(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/modifier.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/modifiers-all-variants.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-bind-shorthand.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-bind.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-on-shorthand.vue(1 hunks)crates/biome_html_parser/tests/quick_test.rs(1 hunks)xtask/codegen/html.ungram(3 hunks)xtask/codegen/src/formatter.rs(3 hunks)xtask/codegen/src/html_kinds_src.rs(2 hunks)
🧰 Additional context used
🧠 Learnings (43)
📚 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.rscrates/biome_html_parser/tests/quick_test.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive.rscrates/biome_html_formatter/src/vue/bogus/mod.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive_argument.rsxtask/codegen/html.ungram
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Implement FormatLanguage for HtmlFormatLanguage with associated types: SyntaxLanguage=HtmlLanguage, Context=HtmlFormatContext, FormatRule=FormatHtmlSyntaxNode
Applied to files:
crates/biome_html_parser/src/syntax/parse_error.rscrates/biome_html_formatter/src/vue/auxiliary/directive.rscrates/biome_html_formatter/src/vue/auxiliary/directive_argument.rscrates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rscrates/biome_html_parser/src/parser.rscrates/biome_html_parser/tests/quick_test.rscrates/biome_html_formatter/src/vue/any/directive.rscrates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.rscrates/biome_html_formatter/src/vue/auxiliary/modifier.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive.rscrates/biome_html_formatter/src/vue/auxiliary/static_argument.rscrates/biome_html_parser/src/syntax/vue.rscrates/biome_html_formatter/src/html/any/attribute.rscrates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rscrates/biome_html_formatter/src/vue/any/directive_argument.rscrates/biome_html_formatter/src/lib.rscrates/biome_html_parser/src/lexer/mod.rscrates/biome_html_parser/src/token_source.rscrates/biome_html_formatter/src/vue/lists/modifier_list.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive_argument.rscrates/biome_html_formatter/src/generated.rscrates/biome_html_formatter/src/html/lists/attribute_list.rscrates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-10-15T09:21:24.116Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:21:24.116Z
Learning: `#[derive(Diagnostic)]` is supported on enums; each variant must contain a type that is itself a diagnostic
Applied to files:
crates/biome_html_parser/src/syntax/parse_error.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_formatter/src/vue/lists/mod.rscrates/biome_html_formatter/src/vue/mod.rscrates/biome_html_formatter/src/vue/bogus/mod.rscrates/biome_html_formatter/src/vue/auxiliary/mod.rscrates/biome_html_formatter/src/vue/any/mod.rscrates/biome_html_formatter/src/lib.rscrates/biome_html_parser/src/lexer/mod.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/**/*.rs : After generation, remove usages of `format_verbatim_node` and implement real formatting with biome_formatter utilities
Applied to files:
crates/biome_html_formatter/src/vue/lists/mod.rscrates/biome_html_formatter/src/vue/auxiliary/directive.rscrates/biome_html_formatter/src/vue/auxiliary/directive_argument.rscrates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rscrates/biome_html_formatter/src/vue/mod.rscrates/biome_html_parser/tests/quick_test.rscrates/biome_html_formatter/src/vue/any/directive.rscrates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.rscrates/biome_html_formatter/src/vue/auxiliary/modifier.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive.rscrates/biome_html_formatter/src/vue/bogus/mod.rscrates/biome_html_formatter/src/vue/auxiliary/static_argument.rscrates/biome_html_formatter/src/html/any/attribute.rscrates/biome_html_formatter/src/vue/auxiliary/mod.rscrates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rscrates/biome_html_formatter/src/vue/any/mod.rscrates/biome_html_formatter/src/vue/any/directive_argument.rscrates/biome_html_formatter/src/lib.rscrates/biome_html_formatter/src/vue/lists/modifier_list.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive_argument.rsxtask/codegen/src/formatter.rscrates/biome_html_formatter/src/generated.rscrates/biome_html_formatter/src/html/lists/attribute_list.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/biome_*_{syntax,factory}/** : Create per-language crates biome_<lang>_syntax and biome_<lang>_factory under crates/
Applied to files:
crates/biome_html_formatter/src/vue/lists/mod.rscrates/biome_html_formatter/src/vue/mod.rscrates/biome_html_formatter/src/vue/bogus/mod.rscrates/biome_html_formatter/src/vue/auxiliary/mod.rscrates/biome_html_formatter/src/vue/any/mod.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/biome_*_{syntax,factory}/src/generated/** : Each new biome_<lang>_{syntax,factory} crate must have a src/generated/ directory for codegen output
Applied to files:
crates/biome_html_formatter/src/vue/lists/mod.rscrates/biome_html_formatter/src/vue/mod.rscrates/biome_html_formatter/src/vue/bogus/mod.rscrates/biome_html_formatter/src/vue/auxiliary/mod.rscrates/biome_html_formatter/src/vue/any/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/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/vue/lists/mod.rscrates/biome_html_formatter/src/vue/mod.rscrates/biome_html_formatter/src/vue/bogus/mod.rscrates/biome_html_formatter/src/vue/auxiliary/mod.rscrates/biome_html_formatter/src/vue/any/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/**/Cargo.toml : Declare the dependency `biome_js_formatter = { version = "0.0.1", path = "../biome_js_formatter" }` for internal installation
Applied to files:
crates/biome_html_formatter/src/vue/lists/mod.rscrates/biome_html_formatter/src/vue/mod.rscrates/biome_html_formatter/src/lib.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/vue/lists/mod.rscrates/biome_html_formatter/src/vue/auxiliary/directive.rscrates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rscrates/biome_html_formatter/src/vue/mod.rscrates/biome_html_formatter/src/vue/any/directive.rscrates/biome_html_formatter/src/vue/bogus/mod.rscrates/biome_html_formatter/src/vue/auxiliary/static_argument.rscrates/biome_html_formatter/src/vue/auxiliary/mod.rscrates/biome_html_formatter/src/vue/any/mod.rscrates/biome_html_formatter/src/vue/any/directive_argument.rscrates/biome_html_formatter/src/lib.rscrates/biome_html_formatter/src/vue/lists/modifier_list.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive_argument.rscrates/biome_html_formatter/src/generated.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/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/vue/lists/mod.rscrates/biome_html_formatter/src/vue/auxiliary/directive.rscrates/biome_html_formatter/src/vue/auxiliary/directive_argument.rscrates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rscrates/biome_html_formatter/src/vue/any/directive.rscrates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.rscrates/biome_html_formatter/src/vue/auxiliary/modifier.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive.rscrates/biome_html_formatter/src/vue/auxiliary/static_argument.rscrates/biome_html_formatter/src/html/any/attribute.rscrates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rscrates/biome_html_formatter/src/vue/any/directive_argument.rscrates/biome_html_formatter/src/lib.rscrates/biome_html_parser/src/token_source.rscrates/biome_html_formatter/src/vue/lists/modifier_list.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive_argument.rscrates/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/vue/lists/mod.rscrates/biome_html_formatter/src/vue/auxiliary/directive.rscrates/biome_html_formatter/src/vue/auxiliary/directive_argument.rscrates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rscrates/biome_html_formatter/src/vue/mod.rscrates/biome_html_formatter/src/vue/any/directive.rscrates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.rscrates/biome_html_formatter/src/vue/auxiliary/modifier.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive.rscrates/biome_html_formatter/src/vue/auxiliary/static_argument.rscrates/biome_html_formatter/src/html/any/attribute.rscrates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rscrates/biome_html_formatter/src/vue/any/directive_argument.rscrates/biome_html_formatter/src/lib.rscrates/biome_html_formatter/src/vue/lists/modifier_list.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive_argument.rsxtask/codegen/src/formatter.rscrates/biome_html_formatter/src/generated.rscrates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/src/*_kinds_src.rs : Add src/<lang>_kinds_src.rs under xtask/codegen that returns a static KindSrc
Applied to files:
crates/biome_html_formatter/src/vue/lists/mod.rscrates/biome_html_formatter/src/vue/mod.rscrates/biome_html_formatter/src/vue/auxiliary/mod.rsxtask/codegen/src/html_kinds_src.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/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/vue/auxiliary/directive.rscrates/biome_html_formatter/src/vue/auxiliary/directive_argument.rscrates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rscrates/biome_html_parser/tests/quick_test.rscrates/biome_html_formatter/src/vue/any/directive.rscrates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.rscrates/biome_html_formatter/src/vue/auxiliary/modifier.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive.rscrates/biome_html_formatter/src/vue/auxiliary/static_argument.rscrates/biome_html_formatter/src/html/any/attribute.rscrates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rscrates/biome_html_formatter/src/vue/any/directive_argument.rscrates/biome_html_formatter/src/lib.rscrates/biome_html_formatter/src/vue/lists/modifier_list.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive_argument.rscrates/biome_html_formatter/src/generated.rscrates/biome_html_formatter/src/html/lists/attribute_list.rscrates/biome_html_parser/src/syntax/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 : 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/vue/auxiliary/directive.rscrates/biome_html_formatter/src/vue/auxiliary/directive_argument.rscrates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rscrates/biome_html_formatter/src/vue/any/directive.rscrates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.rscrates/biome_html_formatter/src/vue/auxiliary/modifier.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive.rscrates/biome_html_formatter/src/vue/auxiliary/static_argument.rscrates/biome_html_formatter/src/html/any/attribute.rscrates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rscrates/biome_html_formatter/src/vue/any/directive_argument.rscrates/biome_html_formatter/src/vue/lists/modifier_list.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive_argument.rscrates/biome_html_formatter/src/generated.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/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/vue/auxiliary/directive.rscrates/biome_html_formatter/src/vue/auxiliary/directive_argument.rscrates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rscrates/biome_html_parser/tests/quick_test.rscrates/biome_html_formatter/src/vue/any/directive.rscrates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.rscrates/biome_html_formatter/src/vue/auxiliary/modifier.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive.rscrates/biome_html_formatter/src/vue/auxiliary/static_argument.rscrates/biome_html_formatter/src/html/any/attribute.rscrates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rscrates/biome_html_formatter/src/vue/any/directive_argument.rscrates/biome_html_formatter/src/lib.rscrates/biome_html_formatter/src/vue/lists/modifier_list.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive_argument.rscrates/biome_html_formatter/src/generated.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Define the HtmlFormatter type alias: `type HtmlFormatter<'buf> = Formatter<'buf, HtmlFormatContext>;`
Applied to files:
crates/biome_html_formatter/src/vue/auxiliary/directive.rscrates/biome_html_formatter/src/vue/auxiliary/directive_argument.rscrates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rscrates/biome_html_formatter/src/vue/any/directive.rscrates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.rscrates/biome_html_formatter/src/vue/auxiliary/modifier.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive.rscrates/biome_html_formatter/src/vue/auxiliary/static_argument.rscrates/biome_html_formatter/src/html/any/attribute.rscrates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rscrates/biome_html_formatter/src/vue/any/directive_argument.rscrates/biome_html_formatter/src/lib.rscrates/biome_html_parser/src/token_source.rscrates/biome_html_formatter/src/vue/lists/modifier_list.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive_argument.rscrates/biome_html_formatter/src/generated.rscrates/biome_html_formatter/src/html/lists/attribute_list.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Create tests/language.rs defining `HtmlTestFormatLanguage` and implement the TestFormatLanguage trait
Applied to files:
crates/biome_html_formatter/src/vue/auxiliary/directive.rscrates/biome_html_formatter/src/vue/auxiliary/directive_argument.rscrates/biome_html_parser/tests/quick_test.rscrates/biome_html_formatter/src/vue/any/directive.rscrates/biome_html_formatter/src/vue/auxiliary/modifier.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive.rscrates/biome_html_formatter/src/html/any/attribute.rscrates/biome_html_formatter/src/vue/any/directive_argument.rscrates/biome_html_formatter/src/lib.rscrates/biome_html_formatter/src/vue/lists/modifier_list.rscrates/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 : 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/vue/auxiliary/directive.rscrates/biome_html_formatter/src/vue/auxiliary/directive_argument.rscrates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rscrates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.rscrates/biome_html_formatter/src/vue/auxiliary/modifier.rscrates/biome_html_formatter/src/vue/auxiliary/static_argument.rscrates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rscrates/biome_html_formatter/src/vue/any/directive_argument.rscrates/biome_html_parser/src/token_source.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive_argument.rscrates/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: The formatter relies on two pillars: implementing `Format`/`FormatNode` for nodes and creating an intermediate IR via helpers
Applied to files:
crates/biome_html_formatter/src/vue/auxiliary/directive.rscrates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.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/vue/auxiliary/directive_argument.rscrates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rscrates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/spec_tests.rs : In tests/spec_tests.rs, generate tests with `tests_macros::gen_tests! {"tests/specs/html/**/*.html", crate::spec_test::run, ""}`
Applied to files:
crates/biome_html_formatter/src/vue/mod.rscrates/biome_html_parser/tests/quick_test.rscrates/biome_html_formatter/src/vue/bogus/mod.rscrates/biome_html_formatter/src/vue/auxiliary/mod.rscrates/biome_html_formatter/src/lib.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/vue/mod.rscrates/biome_html_parser/tests/quick_test.rscrates/biome_html_formatter/src/vue/any/directive.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive.rscrates/biome_html_formatter/src/vue/bogus/mod.rscrates/biome_html_formatter/src/html/any/attribute.rscrates/biome_html_formatter/src/vue/any/directive_argument.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive_argument.rsxtask/codegen/html.ungram
📚 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/quick_test.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/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/quick_test.rscrates/biome_html_parser/tests/html_specs/ok/vue/modifiers-all-variants.vuecrates/biome_html_parser/tests/html_specs/ok/vue/v-bind.vuecrates/biome_html_parser/tests/html_specs/ok/vue/modifier.vue
📚 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/quick_test.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/../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/quick_test.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Place watcher tests related to workspace methods in src/workspace/watcher.tests.rs
Applied to files:
crates/biome_html_parser/tests/quick_test.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to fix code; if a mandatory token/node is missing, return `None` instead
Applied to files:
crates/biome_html_parser/tests/quick_test.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive.rscrates/biome_html_formatter/src/vue/bogus/mod.rscrates/biome_html_formatter/src/vue/bogus/bogus_directive_argument.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Unions of nodes must start with Any* (e.g., AnyHtmlAttribute)
Applied to files:
crates/biome_html_formatter/src/vue/any/directive.rscrates/biome_html_formatter/src/html/any/attribute.rsxtask/codegen/html.ungram
📚 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_formatter/src/vue/auxiliary/modifier.rscrates/biome_html_formatter/src/vue/auxiliary/static_argument.rscrates/biome_html_formatter/src/vue/lists/modifier_list.rscrates/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/src/{type_info,local_inference,resolver,flattening}.rs : Avoid recursive type structures and cross-module Arcs; represent links between types using TypeReference and TypeData::Reference.
Applied to files:
crates/biome_html_formatter/src/vue/bogus/mod.rscrates/biome_html_formatter/src/vue/auxiliary/mod.rscrates/biome_html_formatter/src/vue/any/mod.rs
📚 Learning: 2025-11-09T12:47:46.273Z
Learnt from: ematipico
Repo: biomejs/biome PR: 8031
File: crates/biome_html_parser/src/syntax/svelte.rs:140-147
Timestamp: 2025-11-09T12:47:46.273Z
Learning: In the Biome HTML parser, `expect` and `expect_with_context` consume the current token and then lex the next token. The context parameter in `expect_with_context` controls how the next token (after the consumed one) is lexed, not the current token being consumed. For example, in Svelte parsing, after `bump_with_context(T!["{:"], HtmlLexContext::Svelte)`, the next token is already lexed in the Svelte context, so `expect(T![else])` is sufficient unless the token after `else` also needs to be lexed in a specific context.
Applied to files:
crates/biome_html_parser/src/syntax/vue.rscrates/biome_html_parser/src/lexer/mod.rscrates/biome_html_parser/src/token_source.rscrates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-10-15T09:20:45.587Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_aria_metadata/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:45.587Z
Learning: Applies to crates/biome_aria_metadata/**/{build.rs,aria-data.json} : Keep aria-data.json at the expected location/name because build.rs uses it to generate ARIA metadata
Applied to files:
crates/biome_html_formatter/src/vue/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 : For non-mandatory tokens, use the provided helper constructors (e.g., `token`, `space_token`, `dynamic_token`)
Applied to files:
crates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rscrates/biome_html_parser/src/token_source.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_formatter/src/lib.rscrates/biome_html_parser/src/token_source.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.rs : Add new TypeScript type support by extending the TypeData enum rather than introducing parallel structures.
Applied to files:
crates/biome_html_formatter/src/lib.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/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: 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.rscrates/biome_html_parser/src/token_source.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : All node names in grammar must start with the language prefix (e.g., HtmlSimpleAttribute)
Applied to files:
xtask/codegen/src/html_kinds_src.rsxtask/codegen/html.ungram
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Use conditional syntax (e.g., StrictMode.excluding_syntax) and wrap unsupported constructs into BOGUS nodes via or_invalid_to_bogus
Applied to files:
xtask/codegen/html.ungram
📚 Learning: 2025-10-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: Consult the grammar to choose the appropriate BOGUS node for error recovery contexts
Applied to files:
xtask/codegen/html.ungram
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Add a new language prefix (e.g., html_) to LANGUAGE_PREFIXES in language_kind.rs
Applied to files:
xtask/codegen/src/formatter.rs
🧬 Code graph analysis (18)
crates/biome_html_parser/src/syntax/parse_error.rs (2)
crates/biome_service/src/workspace.rs (1)
markup(1149-1151)crates/biome_parser/src/diagnostic.rs (1)
expected_node(481-483)
crates/biome_html_formatter/src/vue/auxiliary/directive.rs (7)
crates/biome_html_formatter/src/vue/auxiliary/directive_argument.rs (1)
fmt_fields(8-12)crates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rs (1)
fmt_fields(8-23)crates/biome_html_formatter/src/vue/auxiliary/modifier.rs (1)
fmt_fields(8-15)crates/biome_html_formatter/src/vue/auxiliary/static_argument.rs (1)
fmt_fields(8-12)crates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rs (1)
fmt_fields(8-20)crates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.rs (1)
fmt_fields(8-29)crates/biome_html_syntax/src/generated/nodes.rs (14)
name_token(1559-1561)name_token(1651-1653)name_token(1731-1733)arg(1562-1564)arg(1610-1612)arg(1768-1770)arg(1817-1819)modifiers(1565-1567)modifiers(1771-1773)modifiers(1820-1822)initializer(125-127)initializer(1568-1570)initializer(1774-1776)initializer(1823-1825)
crates/biome_html_formatter/src/vue/auxiliary/directive_argument.rs (7)
crates/biome_html_formatter/src/vue/auxiliary/directive.rs (1)
fmt_fields(8-25)crates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rs (1)
fmt_fields(8-23)crates/biome_html_formatter/src/vue/auxiliary/modifier.rs (1)
fmt_fields(8-15)crates/biome_html_formatter/src/vue/auxiliary/static_argument.rs (1)
fmt_fields(8-12)crates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rs (1)
fmt_fields(8-20)crates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.rs (1)
fmt_fields(8-29)crates/biome_html_syntax/src/generated/nodes.rs (5)
colon_token(1607-1609)arg(1562-1564)arg(1610-1612)arg(1768-1770)arg(1817-1819)
crates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rs (3)
crates/biome_html_formatter/src/vue/auxiliary/directive.rs (1)
fmt_fields(8-25)crates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.rs (1)
fmt_fields(8-29)crates/biome_html_syntax/src/generated/nodes.rs (11)
arg(1562-1564)arg(1610-1612)arg(1768-1770)arg(1817-1819)modifiers(1565-1567)modifiers(1771-1773)modifiers(1820-1822)initializer(125-127)initializer(1568-1570)initializer(1774-1776)initializer(1823-1825)
crates/biome_html_parser/tests/quick_test.rs (2)
crates/biome_html_parser/src/lib.rs (1)
parse_html(37-40)crates/biome_test_utils/src/lib.rs (1)
has_bogus_nodes_or_empty_slots(381-396)
crates/biome_html_formatter/src/vue/any/directive.rs (1)
crates/biome_html_formatter/src/generated.rs (16)
fmt(14-20)fmt(52-58)fmt(90-96)fmt(128-134)fmt(160-166)fmt(198-204)fmt(236-242)fmt(274-280)fmt(312-318)fmt(350-356)fmt(390-396)fmt(428-434)fmt(466-472)fmt(502-504)fmt(536-542)fmt(574-580)
crates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.rs (3)
crates/biome_html_formatter/src/vue/auxiliary/directive.rs (1)
fmt_fields(8-25)crates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rs (1)
fmt_fields(8-20)crates/biome_html_syntax/src/generated/nodes.rs (12)
at_token(1814-1816)arg(1562-1564)arg(1610-1612)arg(1768-1770)arg(1817-1819)modifiers(1565-1567)modifiers(1771-1773)modifiers(1820-1822)initializer(125-127)initializer(1568-1570)initializer(1774-1776)initializer(1823-1825)
crates/biome_html_formatter/src/vue/auxiliary/modifier.rs (7)
crates/biome_html_formatter/src/vue/auxiliary/directive.rs (1)
fmt_fields(8-25)crates/biome_html_formatter/src/vue/auxiliary/directive_argument.rs (1)
fmt_fields(8-12)crates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rs (1)
fmt_fields(8-23)crates/biome_html_formatter/src/vue/auxiliary/static_argument.rs (1)
fmt_fields(8-12)crates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rs (1)
fmt_fields(8-20)crates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.rs (1)
fmt_fields(8-29)crates/biome_html_syntax/src/generated/nodes.rs (2)
dot_token(1692-1694)modifier_token(1695-1697)
crates/biome_html_formatter/src/vue/auxiliary/static_argument.rs (4)
crates/biome_html_formatter/src/vue/auxiliary/directive_argument.rs (1)
fmt_fields(8-12)crates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rs (1)
fmt_fields(8-23)crates/biome_html_formatter/src/vue/auxiliary/modifier.rs (1)
fmt_fields(8-15)crates/biome_html_syntax/src/generated/nodes.rs (3)
name_token(1559-1561)name_token(1651-1653)name_token(1731-1733)
crates/biome_html_parser/src/syntax/vue.rs (2)
crates/biome_html_parser/src/syntax/mod.rs (3)
parse_attribute_initializer(468-510)recover(292-302)recover(321-331)crates/biome_html_parser/src/syntax/parse_error.rs (2)
expected_attribute(8-10)expected_vue_directive_argument(112-114)
crates/biome_html_formatter/src/vue/auxiliary/mod.rs (1)
crates/biome_html_syntax/src/generated/nodes.rs (1)
directive(621-623)
crates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rs (7)
crates/biome_html_formatter/src/vue/auxiliary/directive.rs (1)
fmt_fields(8-25)crates/biome_html_formatter/src/vue/auxiliary/directive_argument.rs (1)
fmt_fields(8-12)crates/biome_html_formatter/src/vue/auxiliary/modifier.rs (1)
fmt_fields(8-15)crates/biome_html_formatter/src/vue/auxiliary/static_argument.rs (1)
fmt_fields(8-12)crates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rs (1)
fmt_fields(8-20)crates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.rs (1)
fmt_fields(8-29)crates/biome_html_syntax/src/generated/nodes.rs (5)
l_brack_token(1648-1650)name_token(1559-1561)name_token(1651-1653)name_token(1731-1733)r_brack_token(1654-1656)
crates/biome_html_formatter/src/vue/any/mod.rs (1)
crates/biome_html_syntax/src/generated/nodes.rs (1)
directive(621-623)
crates/biome_html_formatter/src/vue/any/directive_argument.rs (1)
crates/biome_html_formatter/src/generated.rs (16)
fmt(14-20)fmt(52-58)fmt(90-96)fmt(128-134)fmt(160-166)fmt(198-204)fmt(236-242)fmt(274-280)fmt(312-318)fmt(350-356)fmt(390-396)fmt(428-434)fmt(466-472)fmt(502-504)fmt(536-542)fmt(574-580)
crates/biome_html_formatter/src/lib.rs (1)
crates/biome_html_syntax/src/file_source.rs (1)
vue(91-95)
crates/biome_html_formatter/src/generated.rs (3)
crates/biome_js_syntax/src/file_source.rs (2)
vue(217-219)default(28-30)crates/biome_html_syntax/src/file_source.rs (2)
vue(91-95)default(37-39)crates/biome_html_formatter/src/context.rs (1)
default(53-66)
crates/biome_html_formatter/src/html/lists/attribute_list.rs (1)
crates/biome_html_formatter/src/html/any/attribute.rs (1)
fmt(9-18)
crates/biome_html_parser/src/syntax/mod.rs (3)
crates/biome_html_syntax/src/file_source.rs (1)
vue(91-95)crates/biome_html_parser/src/syntax/vue.rs (3)
parse_vue_directive(15-28)parse_vue_v_bind_shorthand_directive(30-50)parse_vue_v_on_shorthand_directive(52-69)crates/biome_html_parser/src/syntax/parse_error.rs (1)
disabled_vue(108-110)
🪛 LanguageTool
.changeset/shy-flowers-decide.md
[style] ~5-~5: As a shorter alternative for ‘able to’, consider using “can now”.
Context: ...mejs/biome": patch --- The HTML parser is now able to parse vue directives. This enables us t...
(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: End-to-end tests
- GitHub Check: Documentation
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test Node.js API
- GitHub Check: autofix
- GitHub Check: Parser conformance
🔇 Additional comments (33)
crates/biome_html_parser/tests/html_specs/ok/vue/v-bind.vue (1)
1-3: LGTM!Clean test case for Vue v-bind directive parsing.
crates/biome_html_parser/tests/html_specs/ok/vue/v-bind-shorthand.vue (1)
1-3: LGTM!Proper test case for Vue v-bind shorthand syntax.
crates/biome_html_parser/src/syntax/parse_error.rs (1)
108-114: LGTM!Both diagnostic helpers follow established patterns and provide clear guidance to users.
crates/biome_html_parser/tests/html_specs/ok/vue/v-on-shorthand.vue (1)
1-3: LGTM!Valid test case for Vue v-on shorthand syntax.
crates/biome_html_formatter/src/vue/auxiliary/static_argument.rs (1)
1-13: LGTM!The formatter implementation follows the established pattern for Vue auxiliary nodes.
xtask/codegen/src/formatter.rs (1)
569-620: LGTM!Vue dialect added correctly to the codegen infrastructure. Note that Vue remains excluded from
all()(line 574-585), which appears intentional for this draft implementation.crates/biome_html_formatter/src/lib.rs (1)
28-28: LGTM!Module declaration added correctly for Vue formatting support.
crates/biome_html_formatter/src/html/lists/attribute_list.rs (1)
75-75: LGTM!Vue directive handling follows the established pattern used for Svelte attributes. Proper delegation to the formatter.
crates/biome_html_formatter/src/vue/lists/mod.rs (1)
1-3: Generated file – no action required.Standard codegen output for Vue modifier list support.
crates/biome_html_parser/src/token_source.rs (1)
30-31: LGTM!New Vue lexer context follows the established pattern. Well-documented.
crates/biome_html_formatter/src/vue/auxiliary/mod.rs (1)
1-9: Generated file – no action required.Codegen output exposing Vue auxiliary formatter modules.
crates/biome_html_formatter/src/vue/any/mod.rs (1)
1-4: Generated file – no action required.Codegen output for Vue directive variant handlers.
crates/biome_html_formatter/src/html/any/attribute.rs (1)
11-11: LGTM!Vue directive variant handled consistently with other attribute types.
crates/biome_html_parser/tests/quick_test.rs (1)
4-18: Development test correctly marked as ignored.This test exercises basic Vue parsing validation. Properly structured with bogus node checks.
crates/biome_html_formatter/src/vue/bogus/mod.rs (1)
1-4: LGTM!Generated module declarations follow the expected pattern for bogus node formatters.
crates/biome_html_formatter/src/vue/mod.rs (1)
1-6: LGTM!Generated module structure is well-organised and follows the formatter's conventions.
crates/biome_html_formatter/src/vue/any/directive_argument.rs (1)
1-16: LGTM!The format delegation pattern correctly handles all AnyVueDirectiveArgument variants.
crates/biome_html_formatter/src/vue/auxiliary/v_bind_shorthand_directive.rs (1)
1-21: LGTM!The formatter correctly handles v-bind shorthand syntax without the name token.
crates/biome_html_formatter/src/vue/bogus/bogus_directive_argument.rs (1)
1-5: LGTM!Proper use of FormatBogusNodeRule for error recovery formatting.
crates/biome_html_formatter/src/vue/bogus/bogus_directive.rs (1)
1-5: LGTM!Proper use of FormatBogusNodeRule for error recovery formatting.
crates/biome_html_formatter/src/vue/auxiliary/dynamic_argument.rs (1)
1-24: LGTM!The formatter correctly handles Vue dynamic argument syntax with proper token sequencing.
crates/biome_html_formatter/src/vue/auxiliary/modifier.rs (1)
1-16: LGTM!Clean implementation following the established formatter pattern. The field extraction and sequential formatting is consistent with the other Vue formatters in this PR.
crates/biome_html_formatter/src/vue/any/directive.rs (1)
1-17: LGTM!Standard generated delegation pattern for the
AnyVueDirectiveunion type, correctly routing to the appropriate formatter for each variant.crates/biome_html_formatter/src/vue/auxiliary/v_on_shorthand_directive.rs (1)
1-30: LGTM!Correctly formats the
@shorthand syntax for Vue event directives. The field ordering matches the expected syntax structure.crates/biome_html_formatter/src/vue/lists/modifier_list.rs (1)
1-10: LGTM!The
join().entries()pattern correctly formats Vue modifier chains (e.g.,.prevent.stop) without introducing unwanted separators.crates/biome_html_parser/src/parser.rs (3)
111-111: LGTM!Vue flag added consistently with other parser options.
142-145: LGTM!Builder method follows the established pattern for parser options.
166-166: LGTM!Correctly enables both double-brace text expressions and Vue directive parsing for
.vuefiles.crates/biome_html_formatter/src/vue/auxiliary/directive.rs (1)
1-26: LGTM!Correctly formats standard Vue directives (e.g.,
v-on:click.prevent="handler"). Field ordering matches the expected syntax structure.xtask/codegen/src/html_kinds_src.rs (3)
23-27: LGTM!The new punctuation tokens cover Vue directive syntax requirements:
:for arguments,@for event shorthand,.for modifiers, and[]for dynamic arguments.
84-92: LGTM!Comprehensive set of Vue directive node types, covering standard directives, shorthands, arguments (static and dynamic), and modifier chains.
100-101: LGTM!Bogus nodes added for proper error recovery when parsing malformed Vue directives.
crates/biome_html_formatter/src/vue/auxiliary/directive_argument.rs (1)
1-13: LGTM!Clean implementation for formatting Vue directive arguments (the
:argumentportion). Follows the established pattern.
| fn is_attribute_name_byte_vue(byte: u8) -> bool { | ||
| is_attribute_name_byte(byte) && byte != b':' && byte != b'.' | ||
| } |
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.
Colons still belong in SVG attribute names
By stripping :/. out of is_attribute_name_byte_vue, identifiers like xlink:href or xml:lang can no longer be tokenised as single attribute names in Vue mode; they’re broken up and inevitably treated as directives. We need to keep these characters for ordinary namespaced attributes (while still letting the directive shorthand through), otherwise every SVG (and some HTML) attribute regresses.
🤖 Prompt for AI Agents
In crates/biome_html_parser/src/lexer/mod.rs around lines 1073–1075, the
Vue-mode attribute name check currently excludes ':' and '.', which prevents
namespaced SVG/HTML attributes like "xlink:href" or "xml:lang" from being
tokenized as a single attribute; restore support for ':' and '.' by removing
those exclusions so is_attribute_name_byte_vue defers to the generic
is_attribute_name_byte (or otherwise allows ':' and '.'), and ensure
directive/shorthand detection remains handled at the higher-level tokenization
step rather than by stripping these characters here.
crates/biome_html_parser/tests/html_specs/ok/vue/modifiers-all-variants.vue
Outdated
Show resolved
Hide resolved
| _ if p.cur_text().starts_with("v-") => { | ||
| HtmlSyntaxFeatures::Vue | ||
| .parse_exclusive_syntax(p, parse_vue_directive, |p, m| disabled_vue(p, m.range(p))) | ||
| } |
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'll admit, doing this is a bit silly. It would be better for the lexer to just output the right token for this. I'll fix it in a future PR, and when this lands I'll create an issue to make sure I don't forget about it.
Edit: see #8059
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/biome_html_parser/src/syntax/mod.rs (1)
339-361: Duplicate match arms forT!["{{"].Lines 339-348 and 350-361 contain identical match arms for
T!["{{"]. This will cause a compilation error or unreachable code. Please remove the duplicate block.Apply this diff to remove the duplicate:
- T!["{{"] => { - let m = p.start(); - HtmlSyntaxFeatures::DoubleTextExpressions - .parse_exclusive_syntax( - p, - |p| parse_double_text_expression(p, HtmlLexContext::InsideTag), - |p, marker| disabled_interpolation(p, marker.range(p)), - ) - .ok(); - - Present(m.complete(p, HTML_ATTRIBUTE)) - } T!["{{"] => { let m = p.start(); - HtmlSyntaxFeatures::DoubleTextExpressions + DoubleTextExpressions .parse_exclusive_syntax( p, - |p| parse_double_text_expression(p, HtmlLexContext::InsideTag), + |p| parse_double_text_expression(p, inside_tag_context(p)), |p, marker| disabled_interpolation(p, marker.range(p)), ) .ok(); Present(m.complete(p, HTML_ATTRIBUTE)) }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (15)
crates/biome_html_factory/src/generated/syntax_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_html_parser/tests/html_specs/ok/vue/modifier.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/modifiers-all-variants.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-bind-dynamic.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-bind-mixed.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-bind.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-dynamic-chains.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-else-if.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-for.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-html-text.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-if.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-mixed-complex.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-model-mixed.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-on-mixed.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_syntax/src/generated/kind.rsis excluded by!**/generated/**,!**/generated/**and included by**
📒 Files selected for processing (16)
crates/biome_html_parser/src/syntax/mod.rs(15 hunks)crates/biome_html_parser/src/syntax/vue.rs(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/modifier.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/modifiers-all-variants.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-bind-dynamic.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-bind-mixed.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-dynamic-chains.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-else-if.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-for.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-html-text.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-if.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-mixed-complex.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-model-mixed.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-on-mixed.vue(1 hunks)xtask/codegen/html.ungram(3 hunks)xtask/codegen/src/html_kinds_src.rs(3 hunks)
✅ Files skipped from review due to trivial changes (1)
- crates/biome_html_parser/tests/html_specs/ok/vue/v-mixed-complex.vue
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/biome_html_parser/tests/html_specs/ok/vue/modifier.vue
🧰 Additional context used
🧠 Learnings (18)
📚 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/ok/vue/v-bind-mixed.vuecrates/biome_html_parser/tests/html_specs/ok/vue/modifiers-all-variants.vuecrates/biome_html_parser/tests/html_specs/ok/vue/v-model-mixed.vuecrates/biome_html_parser/tests/html_specs/ok/vue/v-for.vuecrates/biome_html_parser/tests/html_specs/ok/vue/v-html-text.vue
📚 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/ok/vue/modifiers-all-variants.vuecrates/biome_html_parser/tests/html_specs/ok/vue/v-for.vue
📚 Learning: 2025-11-09T12:47:46.273Z
Learnt from: ematipico
Repo: biomejs/biome PR: 8031
File: crates/biome_html_parser/src/syntax/svelte.rs:140-147
Timestamp: 2025-11-09T12:47:46.273Z
Learning: In the Biome HTML parser, `expect` and `expect_with_context` consume the current token and then lex the next token. The context parameter in `expect_with_context` controls how the next token (after the consumed one) is lexed, not the current token being consumed. For example, in Svelte parsing, after `bump_with_context(T!["{:"], HtmlLexContext::Svelte)`, the next token is already lexed in the Svelte context, so `expect(T![else])` is sufficient unless the token after `else` also needs to be lexed in a specific context.
Applied to files:
crates/biome_html_parser/src/syntax/vue.rscrates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Implement FormatLanguage for HtmlFormatLanguage with associated types: SyntaxLanguage=HtmlLanguage, Context=HtmlFormatContext, FormatRule=FormatHtmlSyntaxNode
Applied to files:
crates/biome_html_parser/src/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
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/cst.rs : Create FormatHtmlSyntaxNode in cst.rs implementing FormatRule<HtmlSyntaxNode> and AsFormat/IntoFormat for HtmlSyntaxNode using the provided plumbing
Applied to files:
crates/biome_html_parser/src/syntax/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 : Import and use the `FormatNode` trait for AST nodes
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: When parsing lists, implement error recovery (e.g., via ParseSeparatedList/ParseNodeList) to avoid infinite loops
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/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
📚 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 : List node types must end with the postfix List (e.g., HtmlAttributeList)
Applied to files:
xtask/codegen/src/html_kinds_src.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
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : All node names in grammar must start with the language prefix (e.g., HtmlSimpleAttribute)
Applied to files:
xtask/codegen/src/html_kinds_src.rsxtask/codegen/html.ungram
📚 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/ok/vue/v-for.vue
📚 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:
xtask/codegen/html.ungram
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Unions of nodes must start with Any* (e.g., AnyHtmlAttribute)
Applied to files:
xtask/codegen/html.ungram
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Nodes for enclosing syntax errors must include the Bogus word (e.g., HtmlBogusAttribute)
Applied to files:
xtask/codegen/html.ungram
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Use conditional syntax (e.g., StrictMode.excluding_syntax) and wrap unsupported constructs into BOGUS nodes via or_invalid_to_bogus
Applied to files:
xtask/codegen/html.ungram
📚 Learning: 2025-10-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: Consult the grammar to choose the appropriate BOGUS node for error recovery contexts
Applied to files:
xtask/codegen/html.ungram
🧬 Code graph analysis (2)
crates/biome_html_parser/src/syntax/vue.rs (2)
crates/biome_html_parser/src/syntax/mod.rs (3)
parse_attribute_initializer(459-501)recover(291-301)recover(320-330)crates/biome_html_parser/src/syntax/parse_error.rs (2)
expected_attribute(8-10)expected_vue_directive_argument(112-114)
crates/biome_html_parser/src/syntax/mod.rs (3)
crates/biome_html_syntax/src/file_source.rs (1)
vue(91-95)crates/biome_html_parser/src/syntax/vue.rs (3)
parse_vue_directive(15-33)parse_vue_v_bind_shorthand_directive(35-55)parse_vue_v_on_shorthand_directive(57-74)crates/biome_html_parser/src/syntax/parse_error.rs (2)
disabled_interpolation(12-14)disabled_vue(108-110)
🔇 Additional comments (25)
crates/biome_html_parser/tests/html_specs/ok/vue/v-bind-mixed.vue (1)
1-22: Solid test coverage for v-bind variations.The test cases thoroughly exercise different v-bind syntax patterns: longhand/shorthand, static/dynamic arguments, modifiers, and multiple directives. Comments are clear and match the code. The edge cases (boolean attributes without explicit values in lines 3, 6, and 21) appropriately test parser robustness.
crates/biome_html_parser/tests/html_specs/ok/vue/v-on-mixed.vue (1)
1-25: Comprehensive v-on test coverage—well done!Excellent coverage of v-on directive variants: long-form syntax, shorthand, dynamic arguments, and modifier combinations. The test cases exercise the parser thoroughly.
crates/biome_html_parser/tests/html_specs/ok/vue/v-model-mixed.vue (1)
1-41: Thorough v-model test coverage!Excellent test fixture covering v-model on native elements, custom components, modifiers, named models, and dynamic arguments. This should validate the parser implementation well.
crates/biome_html_parser/tests/html_specs/ok/vue/v-html-text.vue (1)
1-21: Good mixed directive coverage!This test effectively covers multiple Vue directives in one fixture (v-html, v-text, v-bind, v-on, v-model, v-show, v-for), providing a realistic template scenario.
crates/biome_html_parser/tests/html_specs/ok/vue/v-dynamic-chains.vue (1)
1-49: Excellent stress test for dynamic directive chaining!This fixture thoroughly tests dense combinations of dynamic v-bind and v-on directives with modifiers, which will help ensure the parser handles complex attribute lists correctly.
crates/biome_html_parser/tests/html_specs/ok/vue/v-for.vue (1)
1-45: Comprehensive v-for coverage!Excellent test fixture covering arrays, objects, numeric ranges, nested loops, and interaction with other directives. This should thoroughly validate v-for parsing.
crates/biome_html_parser/tests/html_specs/ok/vue/v-bind-dynamic.vue (1)
1-3: Clean, focused test for dynamic v-bind!Simple and effective test for the dynamic argument syntax. Perfectly focused on testing this specific feature.
crates/biome_html_parser/tests/html_specs/ok/vue/v-if.vue (1)
1-4: Clean v-if/v-else test!Simple and effective test for conditional rendering. Does the job nicely.
crates/biome_html_parser/tests/html_specs/ok/vue/modifiers-all-variants.vue (1)
1-5: Modifier variant test looks good!The test correctly covers modifiers on different directive syntaxes (long-form, v-bind shorthand, v-on shorthand). The previously flagged syntax issue has been resolved.
crates/biome_html_parser/tests/html_specs/ok/vue/v-else-if.vue (1)
1-32: Comprehensive Vue directive coverage.The test fixture covers v-if/v-else-if chains, v-bind (longhand/shorthand), v-on (with dynamic arguments and modifiers), v-model (with modifiers), v-show, and v-for with key bindings. Good coverage of the Vue directive syntax.
xtask/codegen/src/html_kinds_src.rs (3)
23-27: Vue punctuation tokens correctly added.The punctuation mappings for Vue directives (
:,@,.,[,]) are properly defined and follow the existing pattern.
41-41: VUE_IDENT token added.The token is correctly placed in the tokens list for Vue-specific identifiers.
85-102: Vue node types follow conventions.All Vue-related nodes are properly prefixed with
VUE_and include both regular and bogus variants as required. The naming is consistent with the codebase conventions.Based on learnings
crates/biome_html_parser/src/syntax/mod.rs (4)
126-138: Sensible Vue context helper.The
inside_tag_contexthelper elegantly switches lexing context based on the Vue feature flag, avoiding unnecessary diagnostics for Vue-specific punctuation.
362-371: Vue shorthand directives properly integrated.The
:and@shorthand directives are correctly routed to Vue parsers with appropriate feature gating and error messages.
382-385: Vue longhand directive parsing.The
v-prefix check correctly identifies Vue directives and routes them to the Vue parser with proper feature gating.
401-402: Updated attribute detection includes Vue punctuation.The function now correctly recognises
:and@as attribute start tokens when Vue is enabled.crates/biome_html_parser/src/syntax/vue.rs (5)
15-33: Vue directive parsing structure looks sound.The function correctly remaps HTML_LITERAL to VUE_IDENT, optionally parses arguments and modifiers, and handles initializers. The argument is optional (per grammar), so
.ok()is appropriate.
35-55: Proper error recovery for v-bind shorthand.The shorthand directive correctly uses
or_recover_with_token_setsince the argument is required for the shorthand form (unlike the longhand where it's optional after the directive name).
57-74: v-on shorthand correctly implemented.The
@shorthand properly bumps the token with Vue context and tries dynamic argument first (in brackets), then static argument as fallback.
113-142: Modifier list implementation follows patterns.The
VueModifierListcorrectly implementsParseNodeListwith appropriate end conditions and recovery using bogus nodes.
144-155: Modifier parsing looks correct.The function properly bumps the dot token and expects the modifier literal, both in Vue context.
xtask/codegen/html.ungram (3)
45-46: Bogus nodes properly defined.The Vue bogus nodes are correctly defined as
SyntaxElement*for error recovery.Based on learnings
168-168: Vue directives integrated into attribute list.Adding
AnyVueDirectivetoHtmlAttributeListallows Vue directives to appear as attributes, which aligns with Vue's template syntax.
322-386: Well-structured Vue directive grammar.The grammar comprehensively covers:
- Longhand directives (
v-bind:href)- Shorthand directives (
:href,@click)- Static and dynamic arguments
- Modifier chains
- Proper union types with bogus variants
All nodes follow naming conventions with the Vue prefix and proper List suffix.
Based on learnings
| fn parse_vue_static_argument(p: &mut HtmlParser) -> ParsedSyntax { | ||
| let m = p.start(); | ||
|
|
||
| p.expect_with_context(HTML_LITERAL, HtmlLexContext::InsideTagVue); | ||
|
|
||
| Present(m.complete(p, VUE_STATIC_ARGUMENT)) | ||
| } |
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.
🧩 Analysis chain
Verify expect_with_context usage in static argument.
The function uses expect_with_context without first checking if HTML_LITERAL is present. This will emit an error diagnostic if the token is missing. Confirm this is the intended behaviour for static arguments, especially since this function is called from or_else chains where absence should return Absent.
🏁 Script executed:
#!/bin/bash
# Check how parse_vue_static_argument is called and if errors are handled appropriately
rg -n -C3 'parse_vue_static_argument' --type=rustLength of output: 1519
I need to verify the implementation by searching the codebase directly:Based on my research and the learnings provided, I can now issue a definitive conclusion. The review comment raises a valid concern grounded in Biome's documented parser patterns. Rules must return Present if they consume any token and can parse the node with at least some of its children, and must return Absent otherwise without progressing parsing nor adding errors.
The current implementation violates this pattern by:
- Using
expect_with_contextunconditionally—which will emit a diagnostic and consume the token regardless - Being called in an
or_elsechain whereAbsentshould be a valid return value if the construct isn't present - Not checking token presence before consuming
Per the retrieved learnings, the parsing function must first test if the parser is positioned at an if statement and return Absent if that's not the case.
Add a token presence check before consuming the token.
Check if HTML_LITERAL is present at the current position. Return Absent if it's not, or use expect_with_context only if it is:
fn parse_vue_static_argument(p: &mut HtmlParser) -> ParsedSyntax {
let m = p.start();
if !p.at(HTML_LITERAL) {
return Absent;
}
p.expect_with_context(HTML_LITERAL, HtmlLexContext::InsideTagVue);
Present(m.complete(p, VUE_STATIC_ARGUMENT))
}Alternatively, use eat_with_context which returns a boolean and doesn't emit diagnostics:
fn parse_vue_static_argument(p: &mut HtmlParser) -> ParsedSyntax {
if !p.at(HTML_LITERAL) {
return Absent;
}
let m = p.start();
p.eat_with_context(HTML_LITERAL, HtmlLexContext::InsideTagVue);
Present(m.complete(p, VUE_STATIC_ARGUMENT))
}🤖 Prompt for AI Agents
crates/biome_html_parser/src/syntax/vue.rs around lines 91 to 97: the function
unconditionally consumes HTML_LITERAL and emits diagnostics, which breaks the
parser contract for optional branches; change it to first check if the current
token is HTML_LITERAL and return Absent if not, and only then start the node and
consume the token—either by calling p.start() after the check and using
p.eat_with_context(HTML_LITERAL, HtmlLexContext::InsideTagVue) (preferred, no
diagnostics) or, if you need diagnostics, call p.expect_with_context(...) only
after confirming p.at(HTML_LITERAL); finally complete and return
Present(m.complete(p, VUE_STATIC_ARGUMENT)).
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.
Unless there's some evident chance for users, that's just an internal refactor, so we could discard the changeset
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.
It could result in unanticipated parsing errors for people that have the experimental flags enabled. I think it would be good to at least warn users, even though it's experimental. I'll update the changeset to reflect that.
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: 0
♻️ Duplicate comments (1)
crates/biome_html_parser/src/syntax/vue.rs (1)
91-97: Mind the guard before youexpectWe still call
expect_with_contextwithout first confirming anHTML_LITERAL. When the token is missing (think@.stop), we emit the generic literal error, returnPresent, and short-circuit the.or_else/.or_recoverpath that should yield the targetedexpected_vue_directive_argumentdiagnostic. Please bail out withAbsentunless a literal is actually there, then consume it explicitly.-fn parse_vue_static_argument(p: &mut HtmlParser) -> ParsedSyntax { - let m = p.start(); - - p.expect_with_context(HTML_LITERAL, HtmlLexContext::InsideTagVue); - - Present(m.complete(p, VUE_STATIC_ARGUMENT)) -} +fn parse_vue_static_argument(p: &mut HtmlParser) -> ParsedSyntax { + if !p.at(HTML_LITERAL) { + return Absent; + } + + let m = p.start(); + p.bump_with_context(HTML_LITERAL, HtmlLexContext::InsideTagVue); + + Present(m.complete(p, VUE_STATIC_ARGUMENT)) +}
🧹 Nitpick comments (1)
crates/biome_html_parser/tests/html_specs/ok/vue/v-for.vue (1)
7-7: Consider documenting these as edge cases.Combining
v-forandv-ifon the same element is a known Vue anti-pattern. Whilst the parser should handle this syntax (and it's good to test), it might be clearer to either:
- Add comments marking these as edge case tests
- Separate edge cases into a dedicated test file (e.g.,
v-for-edge-cases.vue)This would distinguish valid Vue patterns from syntax the parser should tolerate.
Also applies to: 40-40
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (15)
crates/biome_html_factory/src/generated/syntax_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_html_parser/tests/html_specs/ok/vue/modifier.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/modifiers-all-variants.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-bind-dynamic.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-bind-mixed.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-bind.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-dynamic-chains.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-else-if.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-for.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-html-text.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-if.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-mixed-complex.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-model-mixed.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_parser/tests/html_specs/ok/vue/v-on-mixed.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_syntax/src/generated/kind.rsis excluded by!**/generated/**,!**/generated/**and included by**
📒 Files selected for processing (16)
crates/biome_html_parser/src/syntax/mod.rs(15 hunks)crates/biome_html_parser/src/syntax/vue.rs(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/modifier.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/modifiers-all-variants.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-bind-dynamic.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-bind-mixed.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-dynamic-chains.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-else-if.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-for.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-html-text.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-if.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-mixed-complex.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-model-mixed.vue(1 hunks)crates/biome_html_parser/tests/html_specs/ok/vue/v-on-mixed.vue(1 hunks)xtask/codegen/html.ungram(3 hunks)xtask/codegen/src/html_kinds_src.rs(3 hunks)
✅ Files skipped from review due to trivial changes (1)
- crates/biome_html_parser/tests/html_specs/ok/vue/v-dynamic-chains.vue
🚧 Files skipped from review as they are similar to previous changes (7)
- crates/biome_html_parser/tests/html_specs/ok/vue/v-bind-dynamic.vue
- crates/biome_html_parser/tests/html_specs/ok/vue/modifier.vue
- crates/biome_html_parser/tests/html_specs/ok/vue/modifiers-all-variants.vue
- crates/biome_html_parser/tests/html_specs/ok/vue/v-model-mixed.vue
- crates/biome_html_parser/tests/html_specs/ok/vue/v-else-if.vue
- crates/biome_html_parser/tests/html_specs/ok/vue/v-html-text.vue
- crates/biome_html_parser/tests/html_specs/ok/vue/v-mixed-complex.vue
🧰 Additional context used
🧠 Learnings (29)
📚 Learning: 2025-11-09T12:47:46.273Z
Learnt from: ematipico
Repo: biomejs/biome PR: 8031
File: crates/biome_html_parser/src/syntax/svelte.rs:140-147
Timestamp: 2025-11-09T12:47:46.273Z
Learning: In the Biome HTML parser, `expect` and `expect_with_context` consume the current token and then lex the next token. The context parameter in `expect_with_context` controls how the next token (after the consumed one) is lexed, not the current token being consumed. For example, in Svelte parsing, after `bump_with_context(T!["{:"], HtmlLexContext::Svelte)`, the next token is already lexed in the Svelte context, so `expect(T![else])` is sufficient unless the token after `else` also needs to be lexed in a specific context.
Applied to files:
crates/biome_html_parser/src/syntax/vue.rscrates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When a token is mandatory and present in the AST, use the AST-provided token (e.g., `node.l_paren_token().format()`) instead of emitting a static token
Applied to files:
crates/biome_html_parser/src/syntax/vue.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace.rs : Implement and expose the Workspace trait in src/workspace.rs
Applied to files:
crates/biome_html_parser/src/syntax/vue.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_parser/src/syntax/vue.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to fix code; if a mandatory token/node is missing, return `None` instead
Applied to files:
crates/biome_html_parser/src/syntax/vue.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For non-mandatory tokens, use the provided helper constructors (e.g., `token`, `space_token`, `dynamic_token`)
Applied to files:
crates/biome_html_parser/src/syntax/vue.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_parser/src/syntax/vue.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/vue.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_parser/src/syntax/vue.rscrates/biome_html_parser/src/syntax/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_parser/src/syntax/vue.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Place watcher tests related to workspace methods in src/workspace/watcher.tests.rs
Applied to files:
crates/biome_html_parser/src/syntax/vue.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace/client.rs : WorkspaceClient is for creating connections to the daemon and communicating with WorkspaceServer
Applied to files:
crates/biome_html_parser/src/syntax/vue.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Implement FormatLanguage for HtmlFormatLanguage with associated types: SyntaxLanguage=HtmlLanguage, Context=HtmlFormatContext, FormatRule=FormatHtmlSyntaxNode
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/cst.rs : Create FormatHtmlSyntaxNode in cst.rs implementing FormatRule<HtmlSyntaxNode> and AsFormat/IntoFormat for HtmlSyntaxNode using the provided plumbing
Applied to files:
crates/biome_html_parser/src/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
📚 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.rs : Add new TypeScript type support by extending the TypeData enum rather than introducing parallel structures.
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-10-25T07:22:18.540Z
Learnt from: ematipico
Repo: biomejs/biome PR: 7852
File: crates/biome_css_parser/src/syntax/property/mod.rs:161-168
Timestamp: 2025-10-25T07:22:18.540Z
Learning: In the Biome CSS parser, lexer token emission should not be gated behind parser options like `is_tailwind_directives_enabled()`. The lexer must emit correct tokens regardless of parser options to enable accurate diagnostics and error messages when the syntax is used incorrectly.
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: When parsing lists, implement error recovery (e.g., via ParseSeparatedList/ParseNodeList) to avoid infinite loops
Applied to files:
crates/biome_html_parser/src/syntax/mod.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/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
📚 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
📚 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:
xtask/codegen/html.ungram
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Nodes for enclosing syntax errors must include the Bogus word (e.g., HtmlBogusAttribute)
Applied to files:
xtask/codegen/html.ungram
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Unions of nodes must start with Any* (e.g., AnyHtmlAttribute)
Applied to files:
xtask/codegen/html.ungram
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : All node names in grammar must start with the language prefix (e.g., HtmlSimpleAttribute)
Applied to files:
xtask/codegen/html.ungram
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Use conditional syntax (e.g., StrictMode.excluding_syntax) and wrap unsupported constructs into BOGUS nodes via or_invalid_to_bogus
Applied to files:
xtask/codegen/html.ungram
📚 Learning: 2025-10-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: Consult the grammar to choose the appropriate BOGUS node for error recovery contexts
Applied to files:
xtask/codegen/html.ungram
📚 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/ok/vue/v-bind-mixed.vuecrates/biome_html_parser/tests/html_specs/ok/vue/v-for.vue
📚 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/ok/vue/v-for.vue
📚 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/ok/vue/v-for.vue
🧬 Code graph analysis (2)
crates/biome_html_parser/src/syntax/vue.rs (2)
crates/biome_html_parser/src/syntax/mod.rs (7)
parse_attribute_initializer(459-501)parse_element(140-213)parse_element(280-282)parse_element(312-314)parse_element(635-668)recover(291-301)recover(320-330)crates/biome_html_parser/src/syntax/parse_error.rs (2)
expected_attribute(8-10)expected_vue_directive_argument(112-114)
crates/biome_html_parser/src/syntax/mod.rs (3)
crates/biome_html_syntax/src/file_source.rs (1)
vue(91-95)crates/biome_html_parser/src/syntax/vue.rs (3)
parse_vue_directive(15-33)parse_vue_v_bind_shorthand_directive(35-55)parse_vue_v_on_shorthand_directive(57-74)crates/biome_html_parser/src/syntax/parse_error.rs (3)
disabled_interpolation(12-14)disabled_vue(108-110)expected_attribute(8-10)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: Parser conformance
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: End-to-end tests
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Documentation
- GitHub Check: Check Dependencies
- GitHub Check: Test Node.js API
- GitHub Check: autofix
🔇 Additional comments (4)
crates/biome_html_parser/tests/html_specs/ok/vue/v-if.vue (1)
1-4: LGTM!Clean test fixture for basic
v-if/v-elseconditional rendering. The syntax is valid and the test case is appropriately focused.crates/biome_html_parser/tests/html_specs/ok/vue/v-for.vue (2)
40-41: Verify the v-else semantics here.The
v-elseon line 41 following an element with bothv-forandv-ifhas ambiguous semantics. In Vue,v-elseshould follow av-ifelement, but whenv-foris present, it's unclear what condition triggers the fallback (empty array? all items filtered by v-if?).Could you clarify whether this is intended as a parser edge case test, or if this represents valid Vue usage?
1-45: Good coverage of v-for patterns.This test fixture provides comprehensive coverage of Vue's
v-fordirective, including arrays, objects, ranges, nested loops, and template wrappers. The variety of examples should thoroughly exercise the parser's handling of v-for syntax.xtask/codegen/html.ungram (1)
45-46: Excellent grammar structure for Vue directives!The Vue grammar additions follow all the required conventions:
- Bogus variants (VueBogusDirective, VueBogusDirectiveArgument) properly included in their respective unions
- All node names correctly prefixed with Vue
- Union names follow the Any* pattern
- The asymmetry between VueVBindShorthandDirective (which includes VueDirectiveArgument containing ':') and VueVOnShorthandDirective (which has separate '@') accurately reflects Vue's syntax where
:shortensv-bind:whilst@replacesv-on:entirelyThe integration into AnyHtmlAttribute and the complete directive, argument, and modifier structure are spot on.
Based on learnings.
Also applies to: 168-169, 321-386
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
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.changeset/shy-flowers-decide.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
.changeset/shy-flowers-decide.md
[style] ~5-~5: As a shorter alternative for ‘able to’, consider using “can now”.
Context: ...mejs/biome": patch --- The HTML parser is now able to parse vue directives. This enables us t...
(BE_ABLE_TO)
[uncategorized] ~5-~5: The verb “was” doesn’t seem to fit in this context, “were” is probably more formally correct.
Context: ...ay result in parsing errors where there was none before. For those of you that have...
(AI_HYDRA_LEO_CPT_WAS_WERE)
⏰ 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: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: End-to-end tests
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Check Dependencies
- GitHub Check: Test Node.js API
- GitHub Check: Parser conformance
- GitHub Check: autofix
| "@biomejs/biome": patch | ||
| --- | ||
|
|
||
| The HTML parser is now able to parse vue directives. This enables us to write/port Vue lint rules that require inspecting the `<template>` section. However, this more complex parsing may result in parsing errors where there was none before. For those of you that have opted in to the experimental support (aka `experimentalFullSupportEnabled`), we greatly appreciate your help testing this out, and your bug reports. |
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.
Fix grammar: "were" instead of "was".
The subject "parsing errors" is plural, so the sentence should read "where there were none before".
-The HTML parser is now able to parse vue directives. This enables us to write/port Vue lint rules that require inspecting the `<template>` section. However, this more complex parsing may result in parsing errors where there was none before. For those of you that have opted in to the experimental support (aka `experimentalFullSupportEnabled`), we greatly appreciate your help testing this out, and your bug reports.
+The HTML parser is now able to parse vue directives. This enables us to write/port Vue lint rules that require inspecting the `<template>` section. However, this more complex parsing may result in parsing errors where there were none before. For those of you that have opted in to the experimental support (aka `experimentalFullSupportEnabled`), we greatly appreciate your help testing this out, and your bug reports.Whilst you're at it, consider replacing "able to parse" with "can now parse" for a more concise tone.
🧰 Tools
🪛 LanguageTool
[style] ~5-~5: As a shorter alternative for ‘able to’, consider using “can now”.
Context: ...mejs/biome": patch --- The HTML parser is now able to parse vue directives. This enables us t...
(BE_ABLE_TO)
[uncategorized] ~5-~5: The verb “was” doesn’t seem to fit in this context, “were” is probably more formally correct.
Context: ...ay result in parsing errors where there was none before. For those of you that have...
(AI_HYDRA_LEO_CPT_WAS_WERE)
🤖 Prompt for AI Agents
In .changeset/shy-flowers-decide.md around line 5, fix the grammar and tighten
the phrasing: change "This enables us to write/port Vue lint rules that require
inspecting the `<template>` section. However, this more complex parsing may
result in parsing errors where there was none before." to use the plural verb
"were" ("where there were none before") and replace "is now able to parse" /
"able to parse" with the more concise "can now parse" (e.g., "The HTML parser
can now parse Vue directives. This enables us to write/port Vue lint rules that
require inspecting the `<template>` section. However, this more complex parsing
may result in parsing errors where there were none before.").
Summary
This PR adds support for parsing vue directives in
.vuefiles.I used AI to generate a lot of the test cases.
Test Plan
Added tests.
Docs