-
-
Notifications
You must be signed in to change notification settings - Fork 720
feat(core): full experimental support htmlish languages #7702
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: f1ae998 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 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 |
CodSpeed Performance ReportMerging #7702 will not alter performanceComparing Summary
Footnotes
|
WalkthroughAdds experimental “full HTML” support across CLI, LSP and service layers behind a new workspace feature. Parser/formatter/syntax gain AstroEmbeddedContent and related nodes/rules; DocumentFileSource/from_path and related APIs gain an extra flag to opt into full HTML behaviour. Per-extension output/offset handling is gated by the new FeaturesSupported HtmlFullSupport flag and settings.experimental_full_html_support. Code actions and diagnostics propagate an action/offset field. HTML configuration gains interpolation and experimental_full_support flags. Tests moved to snapshot-based assertions and new full-support CLI tests added. Language-id mappings now accept Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 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_service/src/file_handlers/json.rs (1)
562-618
: Please use the destructured bindings.Once we destructure
params
, any laterparams.*
access touches a moved value and the file won’t compile. Let’s rely on the already boundsettings
,path
, andlanguage
instead.- let CodeActionsParams { - parse, - range, - settings: workspace, + let CodeActionsParams { + parse, + range, + settings, path, module_graph: _, project_layout, @@ - let analyzer_options = workspace.analyzer_options::<JsonLanguage>( - params.path, - ¶ms.language, + let analyzer_options = settings.analyzer_options::<JsonLanguage>( + path, + &language, suppression_reason.as_deref(), ); @@ - AnalyzerVisitorBuilder::new(params.settings, analyzer_options) + AnalyzerVisitorBuilder::new(settings, analyzer_options)
🧹 Nitpick comments (1)
crates/biome_configuration/src/html.rs (1)
39-41
: Update the stale comment on defaults.The formatter now defaults to
true
, yet the note still says “Keep it disabled…”. Let’s refresh the comment so future readers aren’t misled. Cheers!
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (70)
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/check_stdin_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/check_stdin_write_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/check_stdin_write_unsafe_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/format_astro_carriage_return_line_feed_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/format_astro_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/format_astro_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/format_empty_astro_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/format_stdin_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/format_stdin_write_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/lint_and_fix_astro_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/lint_astro_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/lint_stdin_write_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/lint_stdin_write_unsafe_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/sorts_imports_check.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/sorts_imports_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/check_stdin_write_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/check_stdin_write_unsafe_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/format_stdin_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/format_stdin_write_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/format_svelte_carriage_return_line_feed_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/format_svelte_ts_context_module_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/format_svelte_ts_context_module_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/sorts_imports_check.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/check_stdin_write_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/check_stdin_write_unsafe_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/format_empty_vue_js_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/format_empty_vue_ts_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/format_stdin_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/format_stdin_write_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/format_vue_carriage_return_line_feed_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/format_vue_explicit_js_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/format_vue_explicit_js_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/format_vue_generic_component_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/format_vue_implicit_js_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/format_vue_implicit_js_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/format_vue_ts_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/format_vue_ts_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/lint_vue_js_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/lint_vue_ts_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/sorts_imports_check.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/vue_compiler_macros_as_globals.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_indent_script_and_style/indent_svelte_by_cli.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_indent_script_and_style/indent_svelte_by_config.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_indent_script_and_style/indent_svelte_by_default.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_indent_script_and_style/indent_vue_by_cli.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_indent_script_and_style/indent_vue_by_config.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_indent_script_and_style/unindent_vue_by_default.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/format_empty_svelte_js_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/format_empty_svelte_ts_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/format_svelte_explicit_js_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/format_svelte_explicit_js_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/format_svelte_implicit_js_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/format_svelte_implicit_js_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/format_svelte_ts_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/format_svelte_ts_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/html_disabled_by_default.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/html_enabled_by_default.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_factory/src/generated/node_factory.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
crates/biome_html_factory/src/generated/syntax_factory.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
crates/biome_html_parser/tests/html_specs/error/astro/attribute_expression.astro.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_parser/tests/html_specs/error/frontmatter.html.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_parser/tests/html_specs/error/frontmatter_bogus.html.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_parser/tests/html_specs/error/missing_fence.astro.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_parser/tests/html_specs/ok/astro/attribute_expression.astro.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_parser/tests/html_specs/ok/with_fence.astro.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_syntax/src/generated/kind.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
crates/biome_html_syntax/src/generated/macros.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
crates/biome_html_syntax/src/generated/nodes.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
crates/biome_html_syntax/src/generated/nodes_mut.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
packages/@biomejs/backend-jsonrpc/src/workspace.ts
is excluded by!**/backend-jsonrpc/src/workspace.ts
and included by**
📒 Files selected for processing (39)
.changeset/upset-impalas-grab.md
(1 hunks).changeset/wise-forks-hide.md
(1 hunks)crates/biome_cli/src/execute/process_file/format.rs
(1 hunks)crates/biome_cli/src/execute/process_file/lint_and_assist.rs
(1 hunks)crates/biome_cli/src/execute/process_file/workspace_file.rs
(0 hunks)crates/biome_cli/src/execute/std_in.rs
(3 hunks)crates/biome_cli/tests/cases/handle_astro_files.rs
(1 hunks)crates/biome_cli/tests/cases/handle_vue_files.rs
(1 hunks)crates/biome_cli/tests/cases/indent_script_and_style.rs
(1 hunks)crates/biome_cli/tests/commands/format.rs
(2 hunks)crates/biome_configuration/src/html.rs
(1 hunks)crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
(1 hunks)crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs
(1 hunks)crates/biome_html_formatter/src/astro/auxiliary/mod.rs
(1 hunks)crates/biome_html_formatter/src/generated.rs
(1 hunks)crates/biome_html_parser/src/syntax/astro.rs
(2 hunks)crates/biome_html_syntax/src/element_ext.rs
(2 hunks)crates/biome_html_syntax/src/file_source.rs
(1 hunks)crates/biome_js_analyze/tests/spec_tests.rs
(2 hunks)crates/biome_js_syntax/src/file_source.rs
(1 hunks)crates/biome_lsp/src/handlers/analysis.rs
(4 hunks)crates/biome_lsp/src/handlers/formatting.rs
(2 hunks)crates/biome_lsp/src/server.tests.rs
(1 hunks)crates/biome_lsp/src/session.rs
(2 hunks)crates/biome_lsp/src/utils.rs
(1 hunks)crates/biome_service/src/file_handlers/astro.rs
(0 hunks)crates/biome_service/src/file_handlers/css.rs
(2 hunks)crates/biome_service/src/file_handlers/graphql.rs
(2 hunks)crates/biome_service/src/file_handlers/html.rs
(9 hunks)crates/biome_service/src/file_handlers/javascript.rs
(2 hunks)crates/biome_service/src/file_handlers/json.rs
(2 hunks)crates/biome_service/src/file_handlers/mod.rs
(5 hunks)crates/biome_service/src/file_handlers/svelte.rs
(0 hunks)crates/biome_service/src/file_handlers/vue.rs
(0 hunks)crates/biome_service/src/workspace.rs
(1 hunks)crates/biome_service/src/workspace/server.rs
(2 hunks)xtask/codegen/html.ungram
(1 hunks)xtask/codegen/src/html_kinds_src.rs
(1 hunks)xtask/rules_check/src/lib.rs
(1 hunks)
💤 Files with no reviewable changes (4)
- crates/biome_cli/src/execute/process_file/workspace_file.rs
- crates/biome_service/src/file_handlers/svelte.rs
- crates/biome_service/src/file_handlers/vue.rs
- crates/biome_service/src/file_handlers/astro.rs
🧰 Additional context used
📓 Path-based instructions (9)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**
📄 CodeRabbit inference engine (CLAUDE.md)
Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Files:
crates/biome_html_syntax/src/file_source.rs
crates/biome_html_formatter/src/astro/auxiliary/mod.rs
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs
crates/biome_html_formatter/src/generated.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_js_analyze/tests/spec_tests.rs
crates/biome_js_syntax/src/file_source.rs
crates/biome_html_parser/src/syntax/astro.rs
crates/biome_html_syntax/src/element_ext.rs
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_html_syntax/src/file_source.rs
crates/biome_html_formatter/src/astro/auxiliary/mod.rs
crates/biome_lsp/src/utils.rs
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs
crates/biome_cli/tests/cases/handle_vue_files.rs
crates/biome_configuration/src/html.rs
crates/biome_html_formatter/src/generated.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_cli/src/execute/process_file/lint_and_assist.rs
crates/biome_js_analyze/tests/spec_tests.rs
crates/biome_cli/tests/cases/handle_astro_files.rs
crates/biome_service/src/file_handlers/json.rs
crates/biome_js_syntax/src/file_source.rs
crates/biome_lsp/src/handlers/formatting.rs
crates/biome_html_parser/src/syntax/astro.rs
crates/biome_service/src/workspace/server.rs
crates/biome_cli/tests/commands/format.rs
crates/biome_lsp/src/handlers/analysis.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
crates/biome_html_syntax/src/element_ext.rs
crates/biome_service/src/workspace.rs
crates/biome_cli/src/execute/process_file/format.rs
crates/biome_service/src/file_handlers/graphql.rs
crates/biome_lsp/src/session.rs
crates/biome_cli/src/execute/std_in.rs
crates/biome_service/src/file_handlers/html.rs
crates/biome_service/src/file_handlers/css.rs
crates/biome_lsp/src/server.tests.rs
crates/biome_service/src/file_handlers/javascript.rs
crates/biome_service/src/file_handlers/mod.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Before committing, format Rust and TOML files (e.g., via
just f
/just format
)
Files:
crates/biome_html_syntax/src/file_source.rs
crates/biome_html_formatter/src/astro/auxiliary/mod.rs
crates/biome_lsp/src/utils.rs
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs
crates/biome_cli/tests/cases/handle_vue_files.rs
crates/biome_configuration/src/html.rs
crates/biome_html_formatter/src/generated.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_cli/src/execute/process_file/lint_and_assist.rs
crates/biome_js_analyze/tests/spec_tests.rs
crates/biome_cli/tests/cases/handle_astro_files.rs
crates/biome_service/src/file_handlers/json.rs
xtask/codegen/src/html_kinds_src.rs
xtask/rules_check/src/lib.rs
crates/biome_js_syntax/src/file_source.rs
crates/biome_lsp/src/handlers/formatting.rs
crates/biome_html_parser/src/syntax/astro.rs
crates/biome_service/src/workspace/server.rs
crates/biome_cli/tests/commands/format.rs
crates/biome_lsp/src/handlers/analysis.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
crates/biome_html_syntax/src/element_ext.rs
crates/biome_service/src/workspace.rs
crates/biome_cli/src/execute/process_file/format.rs
crates/biome_service/src/file_handlers/graphql.rs
crates/biome_lsp/src/session.rs
crates/biome_cli/src/execute/std_in.rs
crates/biome_service/src/file_handlers/html.rs
crates/biome_service/src/file_handlers/css.rs
crates/biome_lsp/src/server.tests.rs
crates/biome_service/src/file_handlers/javascript.rs
crates/biome_service/src/file_handlers/mod.rs
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Document rules, assists, and options via inline rustdoc in Rust source
Files:
crates/biome_html_syntax/src/file_source.rs
crates/biome_html_formatter/src/astro/auxiliary/mod.rs
crates/biome_lsp/src/utils.rs
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs
crates/biome_cli/tests/cases/handle_vue_files.rs
crates/biome_configuration/src/html.rs
crates/biome_html_formatter/src/generated.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_cli/src/execute/process_file/lint_and_assist.rs
crates/biome_js_analyze/tests/spec_tests.rs
crates/biome_cli/tests/cases/handle_astro_files.rs
crates/biome_service/src/file_handlers/json.rs
xtask/codegen/src/html_kinds_src.rs
xtask/rules_check/src/lib.rs
crates/biome_js_syntax/src/file_source.rs
crates/biome_lsp/src/handlers/formatting.rs
crates/biome_html_parser/src/syntax/astro.rs
crates/biome_service/src/workspace/server.rs
crates/biome_cli/tests/commands/format.rs
crates/biome_lsp/src/handlers/analysis.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
crates/biome_html_syntax/src/element_ext.rs
crates/biome_service/src/workspace.rs
crates/biome_cli/src/execute/process_file/format.rs
crates/biome_service/src/file_handlers/graphql.rs
crates/biome_lsp/src/session.rs
crates/biome_cli/src/execute/std_in.rs
crates/biome_service/src/file_handlers/html.rs
crates/biome_service/src/file_handlers/css.rs
crates/biome_lsp/src/server.tests.rs
crates/biome_service/src/file_handlers/javascript.rs
crates/biome_service/src/file_handlers/mod.rs
**/tests/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place test files under a tests/ directory in each crate
Files:
crates/biome_cli/tests/cases/handle_vue_files.rs
crates/biome_js_analyze/tests/spec_tests.rs
crates/biome_cli/tests/cases/handle_astro_files.rs
crates/biome_cli/tests/commands/format.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
crates/biome_configuration/src/**
📄 CodeRabbit inference engine (CLAUDE.md)
Keep configuration sources under biome_configuration/src/
Files:
crates/biome_configuration/src/html.rs
.changeset/**/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/**/*.md
: Create changesets using thejust new-changeset
command; do not author them manually
In changeset markdown, only use headers #### or #####
Changeset descriptions must end every sentence with a full stop (.)
For bug fixes, start the changeset description with a linked issue reference like “Fixed #1234”
Prefer past tense for what was done and present tense for current behavior in changesets
Files:
.changeset/wise-forks-hide.md
.changeset/upset-impalas-grab.md
xtask/codegen/*.ungram
📄 CodeRabbit inference engine (CLAUDE.md)
Define and modify language grammars in .ungram files; ASTs are generated from these
Files:
xtask/codegen/html.ungram
crates/biome_service/src/workspace.rs
📄 CodeRabbit inference engine (crates/biome_service/CONTRIBUTING.md)
Workspace
trait implementation entry point is located at src/workspace.rs
Files:
crates/biome_service/src/workspace.rs
🧠 Learnings (20)
📚 Learning: 2025-10-02T12:58:00.892Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:00.892Z
Learning: Applies to crates/biome_js_formatter/src/**/*.rs : When a token is mandatory and present in the AST, format using the node’s token accessor (e.g., node.l_paren_token().format()) instead of hardcoding the token
Applied to files:
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
📚 Learning: 2025-10-02T12:58:46.820Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.820Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_test.rs : Provide a `run` function that builds a SpecSnapshot with HtmlFormatLanguage and HtmlTestFormatLanguage and calls `snapshot.test()`
Applied to files:
crates/biome_cli/tests/cases/handle_vue_files.rs
crates/biome_cli/tests/commands/format.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
📚 Learning: 2025-08-17T08:55:30.118Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-17T08:55:30.118Z
Learning: Applies to **/tests/specs/**/*.snap : Use snapshot spec tests stored as .snap files under tests/specs/ (via cargo insta)
Applied to files:
crates/biome_cli/tests/cases/handle_vue_files.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
📚 Learning: 2025-10-02T12:58:46.820Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.820Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Define `pub(crate) type HtmlFormatter<'buf> = Formatter<'buf, HtmlFormatContext>;`
Applied to files:
crates/biome_configuration/src/html.rs
📚 Learning: 2025-10-02T12:58:46.820Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.820Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/cst.rs : Create FormatHtmlSyntaxNode and implement `FormatRule<HtmlSyntaxNode>` plus `AsFormat<HtmlFormatContext>` and `IntoFormat<HtmlFormatContext>` for HtmlSyntaxNode using the provided mapping code
Applied to files:
crates/biome_html_formatter/src/generated.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_html_parser/src/syntax/astro.rs
📚 Learning: 2025-10-02T12:58:46.820Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.820Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Implement `FormatLanguage` for `HtmlFormatLanguage` with associated types: `SyntaxLanguage = HtmlLanguage`, `Context = HtmlFormatContext`, `FormatRule = FormatHtmlSyntaxNode`
Applied to files:
crates/biome_html_formatter/src/generated.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_html_parser/src/syntax/astro.rs
crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-02T12:58:46.820Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.820Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Add the AsFormat, IntoFormat, and FormattedIterExt plumbing traits and impls to lib.rs as provided
Applied to files:
crates/biome_html_formatter/src/generated.rs
crates/biome_lsp/src/handlers/formatting.rs
📚 Learning: 2025-10-02T12:58:00.892Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:00.892Z
Learning: Applies to crates/biome_js_formatter/src/**/*.rs : Implement the Format trait for your AST nodes using biome_js_formatter (use biome_js_formatter::prelude::*, write!, token, dynamic_token, etc.)
Applied to files:
crates/biome_html_formatter/src/generated.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
📚 Learning: 2025-10-02T12:58:00.892Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:00.892Z
Learning: Applies to crates/biome_js_formatter/src/**/*.rs : Import and implement the FormatNode trait for your node types
Applied to files:
crates/biome_html_formatter/src/generated.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-02T12:58:46.820Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.820Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Expose a documented public function `format_node(options: HtmlFormatOptions, root: &HtmlSyntaxNode) -> FormatResult<Formatted<HtmlFormatContext>>` that calls `biome_formatter::format_node(root, HtmlFormatLanguage::new(options))`
Applied to files:
crates/biome_html_formatter/src/generated.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-02T13:00:18.232Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T13:00:18.232Z
Learning: Applies to crates/biome_service/**/biome_lsp/src/server.tests.rs : End-to-end LSP tests reside in biome_lsp/src/server.tests.rs
Applied to files:
crates/biome_lsp/src/handlers/formatting.rs
📚 Learning: 2025-10-02T12:58:46.820Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.820Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_tests.rs : Configure test generation using `tests_macros::gen_tests! {"tests/specs/html/**/*.html", crate::spec_test::run, ""}` inside a formatter::html_module module
Applied to files:
crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-10-02T12:58:46.820Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.820Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/language.rs : Create `HtmlTestFormatLanguage` and implement the `TestFormatLanguage` trait
Applied to files:
crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-08-17T08:55:30.118Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-17T08:55:30.118Z
Learning: Applies to crates/biome_html_formatter/benches/html_formatter.rs : Maintain the HTML formatter benchmark at benches/html_formatter.rs within the biome_html_formatter crate
Applied to files:
crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-10-02T13:00:18.232Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T13:00:18.232Z
Learning: Applies to crates/biome_service/src/workspace.rs : `Workspace` trait implementation entry point is located at src/workspace.rs
Applied to files:
crates/biome_lsp/src/handlers/analysis.rs
crates/biome_service/src/file_handlers/mod.rs
📚 Learning: 2025-10-02T13:00:04.816Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T13:00:04.816Z
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_syntax/src/element_ext.rs
📚 Learning: 2025-10-02T12:56:59.406Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:56:59.406Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Types deriving Diagnostic must implement Debug
Applied to files:
crates/biome_cli/src/execute/process_file/format.rs
📚 Learning: 2025-10-02T12:56:59.406Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:56:59.406Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Prefer implementing diagnostics via #[derive(Diagnostic)] rather than manual trait impls
Applied to files:
crates/biome_cli/src/execute/process_file/format.rs
📚 Learning: 2025-10-02T12:56:59.406Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:56:59.406Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use helper advice types (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) from biome_diagnostics::v2 when suitable; implement Advices manually only when needed for control/performance
Applied to files:
crates/biome_cli/src/execute/process_file/format.rs
📚 Learning: 2025-10-02T12:56:59.406Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:56:59.406Z
Learning: Applies to crates/biome_diagnostics/crates/biome_diagnostics_categories/src/categories.rs : Register any new diagnostic category statically by adding it to crates/biome_diagnostics_categories/src/categories.rs
Applied to files:
crates/biome_cli/src/execute/process_file/format.rs
🧬 Code graph analysis (15)
crates/biome_lsp/src/utils.rs (2)
crates/biome_line_index/src/line_index.rs (1)
offset
(91-95)crates/biome_lsp_converters/src/from_proto.rs (1)
offset
(8-30)
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs (3)
crates/biome_html_syntax/src/generated/nodes.rs (2)
l_fence_token
(78-80)content
(81-83)crates/biome_html_formatter/src/generated.rs (16)
format
(28-33)format
(66-71)format
(104-109)format
(142-144)format
(174-179)format
(212-217)format
(250-255)format
(288-293)format
(326-331)format
(364-370)format
(404-409)format
(442-447)format
(480-485)format
(512-517)format
(550-555)format
(588-594)crates/biome_formatter/src/builders.rs (1)
hard_line_break
(99-101)
crates/biome_cli/tests/cases/handle_vue_files.rs (1)
crates/biome_cli/tests/snap_test.rs (1)
assert_cli_snapshot
(407-409)
crates/biome_html_formatter/src/generated.rs (2)
crates/biome_js_formatter/src/lib.rs (6)
format
(213-213)format
(226-228)into_format
(274-274)into_format
(283-285)into_format
(297-299)into_format
(480-482)crates/biome_html_formatter/src/lib.rs (10)
format
(49-49)format
(62-64)format
(79-84)format
(99-101)format
(295-297)new
(144-146)into_format
(110-110)into_format
(119-121)into_format
(133-135)into_format
(303-305)
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs (1)
crates/biome_html_formatter/src/verbatim.rs (1)
format_html_verbatim_node
(28-36)
crates/biome_js_analyze/tests/spec_tests.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
JsFileSource
(9412-9421)ModuleKind
(9446-9446)crates/biome_formatter_test/src/spec.rs (1)
input_code
(95-97)
crates/biome_service/src/workspace/server.rs (2)
crates/biome_plugin_loader/src/analyzer_grit_plugin.rs (1)
None
(103-103)crates/biome_js_runtime/src/plugin_api.rs (1)
None
(51-51)
crates/biome_cli/tests/commands/format.rs (1)
crates/biome_cli/tests/snap_test.rs (1)
assert_cli_snapshot
(407-409)
crates/biome_cli/tests/cases/indent_script_and_style.rs (1)
crates/biome_cli/tests/snap_test.rs (1)
assert_cli_snapshot
(407-409)
crates/biome_html_syntax/src/element_ext.rs (2)
crates/biome_html_syntax/src/lib.rs (1)
inner_string_text
(119-128)crates/biome_html_syntax/src/generated/nodes.rs (5)
value_token
(201-203)value_token
(331-333)value_token
(526-528)value_token
(766-768)value_token
(801-803)
crates/biome_service/src/workspace.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
TextSize
(9279-9279)
crates/biome_lsp/src/session.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (4)
OpenProjectParams
(9319-9328)OpenProjectResult
(9329-9334)PullDiagnosticsParams
(9591-9605)SupportsFeatureParams
(3-7)
crates/biome_cli/src/execute/std_in.rs (2)
packages/@biomejs/backend-jsonrpc/tests/workspace.test.mjs (1)
printed
(26-29)packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
FormatFileParams
(9679-9682)
crates/biome_service/src/file_handlers/html.rs (5)
crates/biome_js_parser/src/parse.rs (5)
parse_js_with_offset_and_cache
(396-409)parse
(187-192)parse
(233-234)parse
(261-264)cast
(37-43)crates/biome_rowan/src/ast/mod.rs (1)
cast_ref
(142-151)crates/biome_js_syntax/src/file_source.rs (1)
ts
(173-180)crates/biome_service/src/workspace/document.rs (4)
parse
(88-94)parse
(176-176)parse
(181-188)new
(158-172)crates/biome_html_syntax/src/element_ext.rs (1)
value_token
(277-282)
crates/biome_service/src/file_handlers/mod.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (4)
JsFileSource
(9412-9421)TextRange
(9256-9256)TextSize
(9279-9279)DocumentFileSource
(9403-9411)
🔇 Additional comments (10)
.changeset/upset-impalas-grab.md (1)
5-12
: Nice tidy changeset.Everything’s punctuated to spec and reads cleanly. Cheers for making it effortless to ship.
crates/biome_cli/tests/commands/format.rs (1)
3419-3441
: Test correctly reflects HTML formatter now enabled by default.The test rename and assertion flip (from
is_err()
tois_ok()
) accurately capture the change in default behaviour. Snapshot name updated consistently.crates/biome_cli/tests/cases/indent_script_and_style.rs (1)
2-2
: LGTM! Simplifies test imports.Removing
assert_file_contents
aligns with the shift to snapshot-based verification across the test suite.crates/biome_service/src/file_handlers/css.rs (1)
589-653
: LGTM! Correctly propagates action offset.The
action_offset
fromCodeActionsParams
is now properly destructured and assigned to eachCodeAction.offset
. This aligns with the broader refactor removing per-extension offset handling.crates/biome_cli/tests/cases/handle_astro_files.rs (1)
45-52
: Minor test input change.Changed the statement from
statement ( ) ;
tosomething ( ) ;
. Ensure this aligns with intended test behaviour and that corresponding snapshots were updated.crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs (1)
1-22
: LGTM! Formatter implementation follows conventions.The
FormatAstroEmbeddedContent
implementation correctly:
- Uses
format_html_verbatim_node
for verbatim rendering- Implements conditional
embedded_node_range
based onshould_delegate_fmt_embedded_nodes()
This aligns with the broader embedded-content formatting strategy introduced in the PR.
crates/biome_lsp/src/handlers/formatting.rs (2)
16-86
: Good simplification—removes per-extension formatting hooks.The
format
function now usesprinted.into_code()
directly, eliminating the mutableoutput
variable and extension-specific post-processing (Astro/Vue/Svelte handlers). This aligns with the broader refactor consolidating embedded-content handling.
88-176
: Verify range formatting for embedded content in frontmatter and script blocks. No Astro/Vue/Svelte offset handlers remain in crates/biome_lsp; manually test formatting on .astro, .vue and .svelte files to ensure correct edits without offset adjustments.crates/biome_html_parser/src/syntax/astro.rs (1)
30-38
: Approve changes – ASTRO_EMBEDDED_CONTENT is defined in html.ungram.crates/biome_html_syntax/src/element_ext.rs (1)
272-283
: Approve AnyEmbeddedContent.value_token implementation. Both arms returnOption<HtmlSyntaxToken>
—AstroEmbeddedContent.content_token()
returnsOption<SyntaxToken>
(aliased toHtmlSyntaxToken
).
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
🧹 Nitpick comments (1)
crates/biome_js_syntax/src/file_source.rs (1)
203-215
: Drop unused JsFileSource::astro/vue/svelte constructors
None of these public methods are referenced anywhere in this repo; remove them (or deprecate first if you need to preserve the public API).
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.changeset/stupid-groups-grow.md
(1 hunks)crates/biome_cli/src/execute/std_in.rs
(3 hunks)crates/biome_html_syntax/src/file_source.rs
(1 hunks)crates/biome_js_syntax/src/file_source.rs
(1 hunks)xtask/rules_check/src/lib.rs
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- xtask/rules_check/src/lib.rs
- crates/biome_html_syntax/src/file_source.rs
🧰 Additional context used
📓 Path-based instructions (5)
.changeset/**/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/**/*.md
: Create changesets using thejust new-changeset
command; do not author them manually
In changeset markdown, only use headers #### or #####
Changeset descriptions must end every sentence with a full stop (.)
For bug fixes, start the changeset description with a linked issue reference like “Fixed #1234”
Prefer past tense for what was done and present tense for current behavior in changesets
Files:
.changeset/stupid-groups-grow.md
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_cli/src/execute/std_in.rs
crates/biome_js_syntax/src/file_source.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Before committing, format Rust and TOML files (e.g., via
just f
/just format
)
Files:
crates/biome_cli/src/execute/std_in.rs
crates/biome_js_syntax/src/file_source.rs
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Document rules, assists, and options via inline rustdoc in Rust source
Files:
crates/biome_cli/src/execute/std_in.rs
crates/biome_js_syntax/src/file_source.rs
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**
📄 CodeRabbit inference engine (CLAUDE.md)
Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Files:
crates/biome_js_syntax/src/file_source.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: autofix
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_configuration)
🔇 Additional comments (3)
crates/biome_cli/src/execute/std_in.rs (1)
79-82
: Simplified output handling looks clean.Removing the extension-specific file handler branching (Astro, Vue, Svelte) in favour of direct
code
orinto_code()
usage streamlines the logic nicely across all three paths—formatting, fix-file, and post-formatting. The changes align well with the PR's unified HTML-ish language support goal.Also applies to: 169-170, 187-192
crates/biome_js_syntax/src/file_source.rs (2)
151-152
: Nice typo fix!The previous review flagged "embebbed" → "embedded"; now corrected. The Astro example clarifies the embedding context well.
328-342
: .astro, .vue, .svelte handled by HtmlFileSource::try_from_extension
Verified in crates/biome_html_syntax/src/file_source.rs (match includes “astro”, “vue”, “svelte”); no further action required.
Added linting and assist support for `.html` files, with addition of two new configurations: | ||
- `html.linter.enabled` | ||
- `html.assist.enabled` | ||
|
||
The HTML linter, in this release, only contains the rule `noHeaderScope`. More rules will be released in the upcoming releases. |
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.
Pop a full stop on that intro line.
Changeset sentences have to end with a period; the opener currently trails off with a colon, and the bullet text never lands either. Please tighten it up so every sentence closes properly.
-Added linting and assist support for `.html` files, with addition of two new configurations:
-- `html.linter.enabled`
-- `html.assist.enabled`
+Added linting and assist support for `.html` files, introducing two new configurations.
+- Introduced the `html.linter.enabled` configuration.
+- Introduced the `html.assist.enabled` configuration.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Added linting and assist support for `.html` files, with addition of two new configurations: | |
- `html.linter.enabled` | |
- `html.assist.enabled` | |
The HTML linter, in this release, only contains the rule `noHeaderScope`. More rules will be released in the upcoming releases. | |
Added linting and assist support for `.html` files, introducing two new configurations. | |
- Introduced the `html.linter.enabled` configuration. | |
- Introduced the `html.assist.enabled` configuration. | |
The HTML linter, in this release, only contains the rule `noHeaderScope`. More rules will be released in the upcoming releases. |
🤖 Prompt for AI Agents
In .changeset/stupid-groups-grow.md around lines 5 to 9, the introductory
sentence and bullet lines end with a colon or no terminal punctuation; change
the opener to end with a period and add periods at the end of each bullet
sentence so every sentence in the changeset is properly terminated (e.g.,
replace the trailing colon after the intro with a period and append periods to
the bullet lines).
@ematipico did you already fix it? I don't see a regression. |
@mdevils I didn't, see lint run: https://github.com/biomejs/biome/actions/runs/18306065139/job/52123597245?pr=7702 I believe the regression is caused by the fact that Vue blocks are now managed on the HTML side, and to lint the JS inside, we need the |
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.
Very nice! Love the cleanups!
|
||
Now that the main architecture is stable and working, in the upcoming patches and minors we will also fix possible inaccuracies and edge cases coming from existing lint rules, such as `noUnusedVariables` inside `<script>` blocks or frontmatter. | ||
|
||
The support is considered experimental because there might be cases that aren't fine-parsed yet, hence causing possible inaccuracies when it comes to formatting and linting. |
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.
What is "fine-parsed"? Maybe "correctly parsed"?
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.
So, at the moment the content of text expressions {{ }}
is parsed as simple text, so we don't detect any language syntax such as Svelte, which has its own control-flow syntax:
{#if expression}...{/if}
I wanted to frame this, and say that such language cases aren't "correctly parsed", or we don't have a special parsing. Happy to receive suggestions to better frame this!
} else if html_file_source.is_vue() { | ||
file_source = file_source.with_embedding_kind(EmbeddingKind::Vue); | ||
} | ||
} else if html_file_source.is_astro() { |
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.
Why isn't Astro checked here anymore?
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.
Astro frontmatter has its own node, which isn't a AnyHtmlElement
, but a AstroFrontmatter
node. For simplicity, I decided to move the detection logic in its own function.
@ematipico oh, I thought tests for those rules failed. Not sure how these blocks are processed from rule documentation to be honest. |
Amazing work! I waited for this :) Will it be possible to check if |
Yes! I don't know where this information will reside, but to give you an example, we're able to detect if the language inside script is TypeScript: biome/crates/biome_service/src/file_handlers/html.rs Lines 480 to 484 in 3c998e1
|
@ematipico could you please hint me how I can do it from the lint rule (which works in JS/TS context)? |
@mdevils You would pass that information in via |
I just ran this on 2 of my codebases, one vue and one svelte. Vue seemed fine at a glance, but the whitespace sensitivity problems are still there. The svelte codebase was triggering parsing errors all over the place, mostly getting stuck on Regarding the docs changes: I feel like it's a little misleading to mark parsing as experimental for these languages, but mark formatting and linting as fully supported for the current state. I don't want us to rush this out and have this cause problems for our users. |
What do you suggest @dyc3 ? How should we approach this? The reason why I defaulted the formatter and linter to We could wait more and fix the parsing issues, however we don't know how long it will take. We can definitely do more testing! I will appreciate any help I can get |
Hmm, yeah, that's tricky. I think it would be ideal to keep the current default behavior for at least another minor. This would give us more time to iron out the major kinks before forcing the new behavior on everyone, and let people opt in and report issues. Some things we could do:
For communicating support status: We should mark parsing, formatting, and linting as experimental. Linting should have a footnote explaining that for linting, most javascript-only and css-only rules will work fine, but no rules that inspect across the html/language boundary have been implemented. For formatting, we should at least explain that we are still working on parity with prettier. Also, I forgot to mention, we need to check I have a little bit of time today, so I will see if I can finish up #7673 |
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
3c998e1
to
a5f53f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 (2)
crates/biome_service/src/settings.rs (1)
1903-1913
: Overrides drop HTML parser/linter/assist options
to_html_language_settings
only mapsformatter
, silently discardingparser
,linter
, andassist
from overrides. This breaks expected override behaviour (e.g.html.parser.interpolation
in overrides).Map all sections, mirroring the
From<HtmlConfiguration> for LanguageSettings<HtmlLanguage>
impl used for base settings.Apply this diff:
fn to_html_language_settings( mut conf: HtmlConfiguration, _parent_settings: &LanguageSettings<HtmlLanguage>, ) -> LanguageSettings<HtmlLanguage> { let mut language_setting: LanguageSettings<HtmlLanguage> = LanguageSettings::default(); - let formatter = conf.formatter.take().unwrap_or_default(); - - language_setting.formatter = formatter.into(); + if let Some(formatter) = conf.formatter.take() { + language_setting.formatter = formatter.into(); + } + if let Some(parser) = conf.parser.take() { + language_setting.parser = parser.into(); + } + if let Some(linter) = conf.linter.take() { + language_setting.linter = linter.into(); + } + if let Some(assist) = conf.assist.take() { + language_setting.assist = assist.into(); + } language_setting }crates/biome_service/src/workspace.rs (1)
551-566
: Add missinghtmlFullSupport
to TSFeatureKind
In
packages/@biomejs/backend-jsonrpc/src/workspace.ts
, extend theFeatureKind
union (around line 11) to include"htmlFullSupport"
, ensuring clients recognise the new variant.
🧹 Nitpick comments (8)
crates/biome_lsp/src/handlers/analysis.rs (2)
186-189
: fixAll: preserve diagnostic association for embedded scriptsDropping the offset can de-associate diagnostics from fixes in non–full‑HTML mode (Vue/Svelte/Astro). Pass the computed offset when full support is disabled.
- let fix_all = if has_fix_all { - fix_all(session, &url, path, &doc.line_index, &diagnostics, None)? - } else { - None - }; + let fix_all = if has_fix_all { + // Keep offsets only for legacy embedded-mode handling + let action_offset = if file_features.supports_full_html_support() { + None + } else { + offset + }; + fix_all(session, &url, path, &doc.line_index, &diagnostics, action_offset)? + } else { + None + };Please confirm that code_fix_to_lsp and workspace action ranges are already normalised when full support is enabled.
358-377
: Extension matching: preferpath.extension()
to avoidOsStr
pitfalls
path.as_path().extension()
typically yieldsOption<&OsStr>
, which doesn’t pattern‑match against&str
literals. Earlier code usedpath.extension()
(likelyOption<&str>
on BiomePath). Use that for consistency.- let output = if file_features.supports_full_html_support() { + let output = if file_features.supports_full_html_support() { fixed.code } else { - match path.as_path().extension() { + match path.extension() { Some(extension) => { let input = session.workspace.get_file_content(GetFileContentParams { project_key: doc.project_key, path: path.clone(), })?; match extension { "astro" => AstroFileHandler::output(input.as_str(), fixed.code.as_str()), "vue" => VueFileHandler::output(input.as_str(), fixed.code.as_str()), "svelte" => SvelteFileHandler::output(input.as_str(), fixed.code.as_str()), _ => fixed.code, } } _ => fixed.code, } };If
path.extension()
isn’t available here, fall back topath.as_path().extension().and_then(|e| e.to_str())
.crates/biome_cli/tests/cases/handle_svelte_files.rs (1)
226-226
: Rename the variable to match the file type.The variable is named
astro_file_path
but contains a Svelte file path. This appears to be a copy-paste artefact from the Astro tests.Apply this diff to fix the naming:
- let astro_file_path = Utf8Path::new("file.svelte"); + let svelte_file_path = Utf8Path::new("file.svelte");And update the corresponding usages in the
run_cli
andassert_cli_snapshot
calls.Also applies to: 274-274
crates/biome_service/src/file_handlers/html.rs (3)
545-566
: Respect<style lang>
(skip non‑CSS for now)We currently parse every
<style>
block as CSS. Forlang="scss"
/sass"
, Biome doesn’t support those yet; trying to parse them yields noisy errors.Detect
lang
and skip non‑CSS styles (or mark as unsupported) to avoid bogus diagnostics.Can be implemented similar to
is_javascript_tag()
/is_typescript_lang()
checks: gate parsing whenelement.is_style_tag()
and!element.is_plain_css_lang()
.
970-973
: Preserve token kind when updating embedded snippetsReplacing with
make::ident(...)
may change the token kind (e.g. script/style/frontmatter content isn’t an identifier). Prefer keeping the original token kind and only updating its text.Use the existing token with updated text, e.g.:
let new_token = value_token.with_text(snippet.new_code.as_str()); mutation.replace_token(value_token, new_token);If
with_text
isn’t available, create a token with the same kind asvalue_token
rather thanident
.
441-468
: Astro frontmatter defaulting to TS is acceptable, but noteParsing Astro frontmatter as TS is safe (TS ⊃ JS), but if you later surface language in rules, consider a future knob to force JS for projects not using TS.
crates/biome_service/src/workspace/server.rs (1)
242-251
: Don’t hardcode experimental flag in error path
build_capability_error
forcesexperimental_full_html_support = false
, which can misidentify the file source in error messages when the flag is enabled.Thread the real flag through this method (e.g. add a
bool
parameter) and passsettings.experimental_full_html_support_enabled()
at call sites, or derive it from the current document’s stored source.crates/biome_service/src/file_handlers/mod.rs (1)
7-11
: Clarify public exposure intent given planned removal.Making
AstroFileHandler
,SvelteFileHandler
, andVueFileHandler
public (along with their modules) conflicts with the TODO comment at line 815 that suggests removing these handlers in the future. If these handlers are temporary workarounds during the transition to full HTML support, consider keeping them internal to avoid committing to a public API that may be removed soon.Also applies to: 58-58, 66-66, 68-68
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (39)
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/check_stdin_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/check_stdin_write_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/check_stdin_write_unsafe_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/format_astro_carriage_return_line_feed_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/format_empty_astro_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/format_stdin_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/full_support.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/lint_and_fix_astro_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/lint_astro_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/lint_stdin_write_unsafe_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/sorts_imports_check.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/sorts_imports_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/full_support.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/full_support_ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/lint_stdin_write_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/sorts_imports_check.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/format_empty_vue_js_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/format_empty_vue_ts_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/full_support.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/full_support_ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/lint_stdin_write_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/sorts_imports_check.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/format_empty_svelte_js_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/format_empty_svelte_ts_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/html_disabled_by_default.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/html_enabled_by_default.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_factory/src/generated/node_factory.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
crates/biome_html_factory/src/generated/syntax_factory.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
crates/biome_html_parser/tests/html_specs/error/astro/attribute_expression.astro.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_parser/tests/html_specs/error/frontmatter.html.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_parser/tests/html_specs/error/frontmatter_bogus.html.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_parser/tests/html_specs/error/missing_fence.astro.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_parser/tests/html_specs/ok/astro/attribute_expression.astro.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_parser/tests/html_specs/ok/with_fence.astro.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_syntax/src/generated/kind.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
crates/biome_html_syntax/src/generated/macros.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
crates/biome_html_syntax/src/generated/nodes.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
crates/biome_html_syntax/src/generated/nodes_mut.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
packages/@biomejs/backend-jsonrpc/src/workspace.ts
is excluded by!**/backend-jsonrpc/src/workspace.ts
and included by**
📒 Files selected for processing (44)
.changeset/stupid-groups-grow.md
(1 hunks).changeset/upset-impalas-grab.md
(1 hunks).changeset/wise-forks-hide.md
(1 hunks)crates/biome_cli/src/execute/process_file.rs
(1 hunks)crates/biome_cli/src/execute/process_file/check.rs
(3 hunks)crates/biome_cli/src/execute/process_file/format.rs
(3 hunks)crates/biome_cli/src/execute/process_file/lint_and_assist.rs
(6 hunks)crates/biome_cli/src/execute/process_file/search.rs
(1 hunks)crates/biome_cli/src/execute/std_in.rs
(3 hunks)crates/biome_cli/tests/cases/handle_astro_files.rs
(2 hunks)crates/biome_cli/tests/cases/handle_svelte_files.rs
(1 hunks)crates/biome_cli/tests/cases/handle_vue_files.rs
(2 hunks)crates/biome_cli/tests/cases/indent_script_and_style.rs
(1 hunks)crates/biome_cli/tests/commands/format.rs
(2 hunks)crates/biome_configuration/src/html.rs
(2 hunks)crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
(1 hunks)crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs
(1 hunks)crates/biome_html_formatter/src/astro/auxiliary/mod.rs
(1 hunks)crates/biome_html_formatter/src/generated.rs
(1 hunks)crates/biome_html_parser/src/syntax/astro.rs
(2 hunks)crates/biome_html_syntax/src/element_ext.rs
(2 hunks)crates/biome_html_syntax/src/file_source.rs
(1 hunks)crates/biome_js_analyze/tests/spec_tests.rs
(2 hunks)crates/biome_js_syntax/src/file_source.rs
(3 hunks)crates/biome_lsp/src/handlers/analysis.rs
(4 hunks)crates/biome_lsp/src/handlers/formatting.rs
(3 hunks)crates/biome_lsp/src/server.tests.rs
(1 hunks)crates/biome_lsp/src/session.rs
(2 hunks)crates/biome_lsp/src/utils.rs
(1 hunks)crates/biome_service/src/diagnostics.rs
(1 hunks)crates/biome_service/src/file_handlers/css.rs
(2 hunks)crates/biome_service/src/file_handlers/graphql.rs
(2 hunks)crates/biome_service/src/file_handlers/html.rs
(9 hunks)crates/biome_service/src/file_handlers/javascript.rs
(2 hunks)crates/biome_service/src/file_handlers/json.rs
(2 hunks)crates/biome_service/src/file_handlers/mod.rs
(12 hunks)crates/biome_service/src/file_handlers/svelte.rs
(1 hunks)crates/biome_service/src/file_handlers/vue.rs
(1 hunks)crates/biome_service/src/settings.rs
(4 hunks)crates/biome_service/src/workspace.rs
(9 hunks)crates/biome_service/src/workspace/server.rs
(25 hunks)xtask/codegen/html.ungram
(1 hunks)xtask/codegen/src/html_kinds_src.rs
(1 hunks)xtask/rules_check/src/lib.rs
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (20)
- crates/biome_service/src/file_handlers/svelte.rs
- crates/biome_lsp/src/utils.rs
- crates/biome_service/src/file_handlers/json.rs
- crates/biome_cli/tests/commands/format.rs
- crates/biome_cli/src/execute/std_in.rs
- crates/biome_js_syntax/src/file_source.rs
- crates/biome_html_formatter/src/generated.rs
- crates/biome_service/src/file_handlers/css.rs
- crates/biome_lsp/src/session.rs
- crates/biome_service/src/file_handlers/javascript.rs
- crates/biome_html_formatter/src/astro/auxiliary/mod.rs
- .changeset/stupid-groups-grow.md
- xtask/rules_check/src/lib.rs
- xtask/codegen/html.ungram
- crates/biome_js_analyze/tests/spec_tests.rs
- xtask/codegen/src/html_kinds_src.rs
- .changeset/wise-forks-hide.md
- .changeset/upset-impalas-grab.md
- crates/biome_configuration/src/html.rs
- crates/biome_service/src/file_handlers/graphql.rs
🧰 Additional context used
📓 Path-based instructions (6)
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_service/src/diagnostics.rs
crates/biome_cli/src/execute/process_file/lint_and_assist.rs
crates/biome_cli/src/execute/process_file/search.rs
crates/biome_cli/tests/cases/handle_astro_files.rs
crates/biome_cli/src/execute/process_file/check.rs
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs
crates/biome_html_syntax/src/file_source.rs
crates/biome_html_syntax/src/element_ext.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_cli/src/execute/process_file.rs
crates/biome_cli/src/execute/process_file/format.rs
crates/biome_service/src/file_handlers/html.rs
crates/biome_html_parser/src/syntax/astro.rs
crates/biome_lsp/src/handlers/formatting.rs
crates/biome_service/src/workspace.rs
crates/biome_cli/tests/cases/handle_vue_files.rs
crates/biome_service/src/settings.rs
crates/biome_cli/tests/cases/handle_svelte_files.rs
crates/biome_lsp/src/handlers/analysis.rs
crates/biome_service/src/workspace/server.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
crates/biome_service/src/file_handlers/vue.rs
crates/biome_lsp/src/server.tests.rs
crates/biome_service/src/file_handlers/mod.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Before committing, format Rust and TOML files (e.g., via
just f
/just format
)
Files:
crates/biome_service/src/diagnostics.rs
crates/biome_cli/src/execute/process_file/lint_and_assist.rs
crates/biome_cli/src/execute/process_file/search.rs
crates/biome_cli/tests/cases/handle_astro_files.rs
crates/biome_cli/src/execute/process_file/check.rs
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs
crates/biome_html_syntax/src/file_source.rs
crates/biome_html_syntax/src/element_ext.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_cli/src/execute/process_file.rs
crates/biome_cli/src/execute/process_file/format.rs
crates/biome_service/src/file_handlers/html.rs
crates/biome_html_parser/src/syntax/astro.rs
crates/biome_lsp/src/handlers/formatting.rs
crates/biome_service/src/workspace.rs
crates/biome_cli/tests/cases/handle_vue_files.rs
crates/biome_service/src/settings.rs
crates/biome_cli/tests/cases/handle_svelte_files.rs
crates/biome_lsp/src/handlers/analysis.rs
crates/biome_service/src/workspace/server.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
crates/biome_service/src/file_handlers/vue.rs
crates/biome_lsp/src/server.tests.rs
crates/biome_service/src/file_handlers/mod.rs
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Document rules, assists, and options via inline rustdoc in Rust source
Files:
crates/biome_service/src/diagnostics.rs
crates/biome_cli/src/execute/process_file/lint_and_assist.rs
crates/biome_cli/src/execute/process_file/search.rs
crates/biome_cli/tests/cases/handle_astro_files.rs
crates/biome_cli/src/execute/process_file/check.rs
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs
crates/biome_html_syntax/src/file_source.rs
crates/biome_html_syntax/src/element_ext.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_cli/src/execute/process_file.rs
crates/biome_cli/src/execute/process_file/format.rs
crates/biome_service/src/file_handlers/html.rs
crates/biome_html_parser/src/syntax/astro.rs
crates/biome_lsp/src/handlers/formatting.rs
crates/biome_service/src/workspace.rs
crates/biome_cli/tests/cases/handle_vue_files.rs
crates/biome_service/src/settings.rs
crates/biome_cli/tests/cases/handle_svelte_files.rs
crates/biome_lsp/src/handlers/analysis.rs
crates/biome_service/src/workspace/server.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
crates/biome_service/src/file_handlers/vue.rs
crates/biome_lsp/src/server.tests.rs
crates/biome_service/src/file_handlers/mod.rs
**/tests/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place test files under a tests/ directory in each crate
Files:
crates/biome_cli/tests/cases/handle_astro_files.rs
crates/biome_cli/tests/cases/handle_vue_files.rs
crates/biome_cli/tests/cases/handle_svelte_files.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**
📄 CodeRabbit inference engine (CLAUDE.md)
Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Files:
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs
crates/biome_html_syntax/src/file_source.rs
crates/biome_html_syntax/src/element_ext.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_html_parser/src/syntax/astro.rs
crates/biome_service/src/workspace.rs
📄 CodeRabbit inference engine (crates/biome_service/CONTRIBUTING.md)
Workspace
trait implementation entry point is located at src/workspace.rs
Files:
crates/biome_service/src/workspace.rs
🧠 Learnings (15)
📚 Learning: 2025-10-02T13:00:04.826Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T13:00:04.826Z
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_syntax/src/element_ext.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/cst.rs : Create FormatHtmlSyntaxNode and implement `FormatRule<HtmlSyntaxNode>` plus `AsFormat<HtmlFormatContext>` and `IntoFormat<HtmlFormatContext>` for HtmlSyntaxNode using the provided mapping code
Applied to files:
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_html_parser/src/syntax/astro.rs
crates/biome_service/src/file_handlers/vue.rs
📚 Learning: 2025-10-02T12:58:00.914Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:00.914Z
Learning: Applies to crates/biome_js_formatter/src/**/*.rs : Implement the Format trait for your AST nodes using biome_js_formatter (use biome_js_formatter::prelude::*, write!, token, dynamic_token, etc.)
Applied to files:
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Implement `FormatLanguage` for `HtmlFormatLanguage` with associated types: `SyntaxLanguage = HtmlLanguage`, `Context = HtmlFormatContext`, `FormatRule = FormatHtmlSyntaxNode`
Applied to files:
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_service/src/file_handlers/html.rs
crates/biome_html_parser/src/syntax/astro.rs
crates/biome_service/src/file_handlers/vue.rs
📚 Learning: 2025-10-02T12:58:00.914Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:00.914Z
Learning: Applies to crates/biome_js_formatter/src/**/*.rs : Import and implement the FormatNode trait for your node types
Applied to files:
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-02T12:58:00.914Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:00.914Z
Learning: Applies to crates/biome_js_formatter/src/**/*.rs : When a token is mandatory and present in the AST, format using the node’s token accessor (e.g., node.l_paren_token().format()) instead of hardcoding the token
Applied to files:
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Expose a documented public function `format_node(options: HtmlFormatOptions, root: &HtmlSyntaxNode) -> FormatResult<Formatted<HtmlFormatContext>>` that calls `biome_formatter::format_node(root, HtmlFormatLanguage::new(options))`
Applied to files:
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_service/src/file_handlers/html.rs
crates/biome_service/src/file_handlers/vue.rs
📚 Learning: 2025-10-02T13:00:18.243Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T13:00:18.243Z
Learning: Applies to crates/biome_service/**/biome_lsp/src/server.tests.rs : End-to-end LSP tests reside in biome_lsp/src/server.tests.rs
Applied to files:
crates/biome_lsp/src/handlers/formatting.rs
crates/biome_cli/tests/cases/handle_svelte_files.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_test.rs : Provide a `run` function that builds a SpecSnapshot with HtmlFormatLanguage and HtmlTestFormatLanguage and calls `snapshot.test()`
Applied to files:
crates/biome_cli/tests/cases/handle_vue_files.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
📚 Learning: 2025-08-17T08:55:30.118Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-17T08:55:30.118Z
Learning: Applies to **/tests/specs/**/*.snap : Use snapshot spec tests stored as .snap files under tests/specs/ (via cargo insta)
Applied to files:
crates/biome_cli/tests/cases/handle_vue_files.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/language.rs : Create `HtmlTestFormatLanguage` and implement the `TestFormatLanguage` trait
Applied to files:
crates/biome_service/src/file_handlers/vue.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/context.rs : Define HtmlFormatContext with fields `comments: Rc<HtmlComments>` and `source_map: Option<TransformSourceMap>`, provide `new` and `with_source_map`, and implement FormatContext and CstFormatContext
Applied to files:
crates/biome_service/src/file_handlers/vue.rs
📚 Learning: 2025-08-17T08:55:30.118Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-17T08:55:30.118Z
Learning: Applies to crates/biome_html_formatter/benches/html_formatter.rs : Maintain the HTML formatter benchmark at benches/html_formatter.rs within the biome_html_formatter crate
Applied to files:
crates/biome_service/src/file_handlers/vue.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Define `pub(crate) type HtmlFormatter<'buf> = Formatter<'buf, HtmlFormatContext>;`
Applied to files:
crates/biome_service/src/file_handlers/vue.rs
📚 Learning: 2025-10-02T13:00:18.243Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T13:00:18.243Z
Learning: Applies to crates/biome_service/src/workspace.rs : `Workspace` trait implementation entry point is located at src/workspace.rs
Applied to files:
crates/biome_service/src/file_handlers/mod.rs
🧬 Code graph analysis (21)
crates/biome_service/src/diagnostics.rs (2)
crates/biome_service/src/file_handlers/mod.rs (1)
from_path
(283-285)crates/biome_resolver/src/lib.rs (1)
from_path
(1112-1114)
crates/biome_cli/src/execute/process_file/lint_and_assist.rs (4)
crates/biome_js_syntax/src/file_source.rs (3)
astro
(203-205)svelte
(213-215)vue
(208-210)packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
FeaturesSupported
(15-15)crates/biome_service/src/file_handlers/svelte.rs (3)
output
(43-54)input
(34-39)start
(57-59)crates/biome_service/src/file_handlers/vue.rs (3)
output
(43-54)input
(34-39)start
(57-59)
crates/biome_cli/src/execute/process_file/search.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
DocumentFileSource
(9403-9411)crates/biome_service/src/file_handlers/mod.rs (1)
from_path
(283-285)
crates/biome_cli/tests/cases/handle_astro_files.rs (3)
crates/biome_cli/tests/cases/handle_svelte_files.rs (1)
full_support
(217-262)crates/biome_cli/tests/cases/handle_vue_files.rs (1)
full_support
(471-516)crates/biome_cli/tests/main.rs (1)
run_cli
(332-347)
crates/biome_cli/src/execute/process_file/check.rs (3)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
FeaturesSupported
(15-15)crates/biome_cli/src/execute/process_file/lint_and_assist.rs (1)
analyze_with_guard
(49-185)crates/biome_cli/src/execute/process_file/format.rs (1)
format_with_guard
(37-136)
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs (3)
crates/biome_html_syntax/src/generated/nodes.rs (2)
l_fence_token
(78-80)content
(81-83)crates/biome_html_formatter/src/generated.rs (16)
format
(28-33)format
(66-71)format
(104-109)format
(142-144)format
(174-179)format
(212-217)format
(250-255)format
(288-293)format
(326-331)format
(364-370)format
(404-409)format
(442-447)format
(480-485)format
(512-517)format
(550-555)format
(588-594)crates/biome_formatter/src/builders.rs (1)
hard_line_break
(99-101)
crates/biome_html_syntax/src/element_ext.rs (2)
crates/biome_html_syntax/src/lib.rs (1)
inner_string_text
(119-128)crates/biome_html_syntax/src/generated/nodes.rs (5)
value_token
(201-203)value_token
(331-333)value_token
(526-528)value_token
(766-768)value_token
(801-803)
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs (2)
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs (1)
fmt_fields
(8-24)crates/biome_html_formatter/src/verbatim.rs (1)
format_html_verbatim_node
(28-36)
crates/biome_cli/src/execute/process_file.rs (4)
crates/biome_service/src/workspace.rs (1)
file_features
(1417-1420)crates/biome_service/src/workspace/server.rs (1)
file_features
(1095-1117)crates/biome_cli/src/execute/process_file/format.rs (1)
format
(17-34)crates/biome_cli/src/execute/process_file/check.rs (1)
check_file
(11-104)
crates/biome_cli/src/execute/process_file/format.rs (4)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
FeaturesSupported
(15-15)crates/biome_lsp/src/handlers/formatting.rs (1)
format
(21-104)crates/biome_service/src/file_handlers/svelte.rs (3)
format
(144-166)output
(43-54)input
(34-39)crates/biome_service/src/file_handlers/vue.rs (3)
format
(144-166)output
(43-54)input
(34-39)
crates/biome_service/src/file_handlers/html.rs (4)
crates/biome_js_parser/src/parse.rs (5)
parse_js_with_offset_and_cache
(396-409)parse
(187-192)parse
(233-234)parse
(261-264)cast
(37-43)crates/biome_rowan/src/ast/mod.rs (1)
cast_ref
(142-151)crates/biome_js_syntax/src/file_source.rs (2)
ts
(173-180)js_module
(158-160)crates/biome_html_syntax/src/element_ext.rs (1)
value_token
(277-282)
crates/biome_lsp/src/handlers/formatting.rs (5)
crates/biome_js_syntax/src/file_source.rs (3)
astro
(203-205)svelte
(213-215)vue
(208-210)crates/biome_service/src/workspace.rs (1)
file_features
(1417-1420)crates/biome_service/src/workspace/server.rs (1)
file_features
(1095-1117)crates/biome_service/src/file_handlers/svelte.rs (2)
output
(43-54)input
(34-39)crates/biome_service/src/file_handlers/vue.rs (2)
output
(43-54)input
(34-39)
crates/biome_service/src/workspace.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (3)
SupportKind
(16-21)FeatureKind
(11-11)TextSize
(9279-9279)
crates/biome_cli/tests/cases/handle_vue_files.rs (4)
crates/biome_cli/tests/snap_test.rs (1)
assert_cli_snapshot
(407-409)crates/biome_cli/tests/cases/handle_astro_files.rs (1)
full_support
(191-236)crates/biome_cli/tests/cases/handle_svelte_files.rs (2)
full_support
(217-262)full_support_ts
(265-315)crates/biome_cli/tests/main.rs (1)
run_cli
(332-347)
crates/biome_service/src/settings.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
HtmlConfiguration
(246-260)FeatureKind
(11-11)
crates/biome_cli/tests/cases/handle_svelte_files.rs (5)
crates/biome_cli/tests/cases/handle_astro_files.rs (1)
full_support
(191-236)crates/biome_cli/tests/cases/handle_vue_files.rs (2)
full_support
(471-516)full_support_ts
(519-569)crates/biome_fs/src/fs/memory.rs (1)
default
(37-49)crates/biome_cli/tests/main.rs (1)
run_cli
(332-347)crates/biome_cli/tests/snap_test.rs (1)
assert_cli_snapshot
(407-409)
crates/biome_lsp/src/handlers/analysis.rs (4)
crates/biome_js_syntax/src/file_source.rs (3)
astro
(203-205)svelte
(213-215)vue
(208-210)crates/biome_service/src/file_handlers/svelte.rs (2)
output
(43-54)input
(34-39)crates/biome_service/src/file_handlers/vue.rs (2)
output
(43-54)input
(34-39)crates/biome_service/src/workspace/server.rs (1)
file_features
(1095-1117)
crates/biome_service/src/workspace/server.rs (2)
crates/biome_service/src/workspace.rs (1)
index
(590-599)crates/biome_service/src/file_handlers/mod.rs (2)
from_path
(283-285)can_contain_embeds
(400-412)
crates/biome_cli/tests/cases/indent_script_and_style.rs (1)
crates/biome_cli/tests/snap_test.rs (1)
assert_cli_snapshot
(407-409)
crates/biome_service/src/file_handlers/vue.rs (1)
crates/biome_ruledoc_utils/src/codeblock.rs (1)
document_file_source
(96-98)
crates/biome_service/src/file_handlers/mod.rs (4)
crates/biome_js_syntax/src/file_source.rs (5)
astro
(203-205)svelte
(213-215)vue
(208-210)try_from_well_known
(309-325)try_from_extension
(328-349)crates/biome_html_syntax/src/file_source.rs (6)
astro
(85-89)svelte
(96-100)vue
(91-95)html
(43-47)try_from_well_known
(103-109)try_from_extension
(112-121)crates/biome_service/src/file_handlers/svelte.rs (1)
file_source
(67-80)crates/biome_service/src/file_handlers/vue.rs (1)
file_source
(67-80)
⏰ 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). (13)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Documentation
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: End-to-end tests
- GitHub Check: Check Dependencies
- GitHub Check: lint
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: autofix
- GitHub Check: Validate PR title
🔇 Additional comments (27)
crates/biome_html_syntax/src/file_source.rs (1)
136-136
: Properly addresses the previous review concern.The change now accepts both "vue" and "vuejs" language IDs, maintaining backward compatibility with VS Code whilst supporting alternative identifiers. This matches the suggested fix exactly.
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs (2)
13-17
: LGTM! Clean refactoring to use embedded content node.The field rename from
content_token
tocontent
and the type change toAstroEmbeddedContent
improves the AST structure by treating frontmatter content as a proper embedded content node rather than an optional token.
19-21
: LGTM! Formatting logic is correct and simplified.The unconditional formatting of
content
is appropriate sinceAstroEmbeddedContent
is now a required node. The sequence (left fence → hard line break → content → hard line break → right fence) correctly formats Astro frontmatter blocks.crates/biome_lsp/src/server.tests.rs (1)
4039-4045
: Verify the trailing newline matches actual formatter output.The expected output now includes a trailing newline after
<!doctype html>
. Please confirm this matches the actual formatter behaviour for Astro files.crates/biome_lsp/src/handlers/analysis.rs (1)
17-19
: Good switch to explicit handler importsClearer and avoids broad namespace use. No concerns.
crates/biome_cli/src/execute/process_file/search.rs (1)
38-38
: LGTM!The addition of the experimental HTML support flag (hardcoded to
false
) aligns with the updated API. For search functionality, disabling experimental features seems reasonable.crates/biome_html_syntax/src/element_ext.rs (1)
272-283
: Verify the method naming asymmetry.The implementation delegates to
value_token()
forHtmlEmbeddedContent
butcontent_token()
forAstroEmbeddedContent
. Is this naming difference intentional, or should both variants use consistently named methods?crates/biome_lsp/src/handlers/formatting.rs (2)
81-94
: LGTM!The conditional per-extension handling based on the full HTML support feature flag maintains backward compatibility whilst enabling the new experimental path.
169-186
: LGTM!The offset computation correctly adjusts ranges for embedded script content in Vue/Astro/Svelte files, ensuring the formatter operates on the correct text boundaries.
crates/biome_cli/src/execute/process_file/lint_and_assist.rs (3)
18-25
: LGTM!The signature changes correctly propagate the
FeaturesSupported
flag through the lint and assist pipeline, enabling feature-gated behaviour.Also applies to: 49-56
100-113
: LGTM!The conditional per-extension output handling maintains backward compatibility for existing workflows whilst supporting the new experimental HTML path.
141-150
: LGTM!The offset calculation is correctly gated by the full HTML support flag, ensuring diagnostics are reported at the correct positions.
crates/biome_service/src/file_handlers/vue.rs (1)
151-151
: LGTM!Simplifying the format options retrieval by using the
document_file_source
directly aligns with the broader HTML support refactoring.crates/biome_service/src/diagnostics.rs (1)
516-516
: LGTM!The API change is applied consistently, with the experimental flag set to
false
for diagnostic reporting.crates/biome_cli/src/execute/process_file/check.rs (1)
11-15
: LGTM!Passing
FeaturesSupported
by reference avoids unnecessary copies and aligns with idiomatic Rust patterns.Also applies to: 37-44, 76-76
crates/biome_cli/src/execute/process_file.rs (1)
200-208
: LGTM!Clean parameter propagation through the call chain. The file features are correctly threaded to lint, format, and check operations.
crates/biome_html_parser/src/syntax/astro.rs (1)
30-38
: LGTM!Good extraction of the embedded content parsing logic. This improves modularity and aligns with the broader embedded content support.
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs (1)
1-22
: LGTM!The formatter implementation correctly follows the established pattern for HTML formatting rules. The conditional embedded node range delegation via
should_delegate_fmt_embedded_nodes()
is appropriate for the experimental feature.Based on learnings
crates/biome_cli/tests/cases/handle_astro_files.rs (1)
190-236
: LGTM!The full-support test follows the consistent pattern established across Vue, Svelte, and Astro test suites. Good coverage of the experimental feature.
crates/biome_cli/tests/cases/indent_script_and_style.rs (1)
1-196
: LGTM!Clean migration to snapshot-based verification. This aligns with the broader test suite modernisation across the PR.
crates/biome_cli/src/execute/process_file/format.rs (1)
95-118
: LGTM!The conditional gating based on
supports_full_html_support()
correctly preserves backward compatibility whilst enabling the new experimental path.crates/biome_service/src/settings.rs (1)
312-320
: OK to never ignore HtmlFullSupportReturning
false
forFeatureKind::HtmlFullSupport
makes sense; the flag is capability‑gating, not subject to includes.crates/biome_service/src/workspace/server.rs (1)
1569-1602
: Nice: embed code‑action offsets plumbed through
action_offset
is passed for embedded snippets; downstreamCodeAction.offset
is set. This will help clients map edits correctly.crates/biome_service/src/workspace.rs (2)
222-231
: Experimental flag correctly reflected in featuresMarking
HtmlFullSupport
as supported when the experimental flag is on is clean and isolated.
983-991
: No action needed: TSCodeAction
already includesoffset?: TextSize
crates/biome_service/src/file_handlers/mod.rs (2)
137-151
: Detection order correctly implements experimental HTML support.The conditional logic properly prioritises HTML-ish language detection when the experimental flag is enabled. This allows
.vue
,.astro
, and.svelte
files to be handled by the HTML parser with embedded JS, rather than the JS parser with HTML templates.Also applies to: 173-188
729-729
: Good addition of Debug trait.Adding
#[derive(Debug)]
toFormatEmbedNode
improves debuggability. This is a helpful change, especially for troubleshooting embedding-related issues.
fn try_from_well_known( | ||
path: &Utf8Path, | ||
experimental_full_html_support: bool, | ||
) -> Result<Self, FileSourceError> { | ||
if let Ok(file_source) = JsonFileSource::try_from_well_known(path) { | ||
return Ok(file_source.into()); | ||
} | ||
if let Ok(file_source) = JsFileSource::try_from_well_known(path) { | ||
return Ok(file_source.into()); | ||
if experimental_full_html_support { | ||
if let Ok(file_source) = HtmlFileSource::try_from_well_known(path) { | ||
return Ok(file_source.into()); | ||
} | ||
if let Ok(file_source) = JsFileSource::try_from_well_known(path) { | ||
return Ok(file_source.into()); | ||
} | ||
} else { | ||
if let Ok(file_source) = JsFileSource::try_from_well_known(path) { | ||
return Ok(file_source.into()); | ||
} | ||
if let Ok(file_source) = HtmlFileSource::try_from_well_known(path) { | ||
return Ok(file_source.into()); | ||
} | ||
} | ||
|
||
if let Ok(file_source) = CssFileSource::try_from_well_known(path) { | ||
return Ok(file_source.into()); | ||
} | ||
if let Ok(file_source) = GraphqlFileSource::try_from_well_known(path) { | ||
return Ok(file_source.into()); | ||
} | ||
if let Ok(file_source) = HtmlFileSource::try_from_well_known(path) { | ||
return Ok(file_source.into()); | ||
} | ||
|
||
Err(FileSourceError::UnknownFileName) | ||
} | ||
|
||
/// Returns the document file source corresponding to this file name from well-known files | ||
pub fn from_well_known(path: &Utf8Path) -> Self { | ||
Self::try_from_well_known(path).unwrap_or(Self::Unknown) | ||
} | ||
pub fn from_well_known(path: &Utf8Path, experimental_full_html_support: bool) -> Self { | ||
Self::try_from_well_known(path, experimental_full_html_support).unwrap_or(Self::Unknown) | ||
} |
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.
🛠️ Refactor suggestion | 🟠 Major
Document the experimental_full_html_support
parameter.
The new experimental_full_html_support
parameter fundamentally changes file source detection priority (HTML before JS when enabled), but lacks rustdoc comments explaining its purpose, behaviour, and implications. Add documentation to help users understand when and why to enable this flag.
Apply this diff to add documentation:
+ /// Attempts to determine file source from well-known file patterns.
+ ///
+ /// # Arguments
+ ///
+ /// * `path` - The file path to check
+ /// * `experimental_full_html_support` - When `true`, prioritises HTML-ish language detection
+ /// (e.g., .vue, .astro, .svelte files are treated as HTML with embedded JS rather than JS with HTML templates)
fn try_from_well_known(
path: &Utf8Path,
experimental_full_html_support: bool,
) -> Result<Self, FileSourceError> {
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
fn try_from_well_known( | |
path: &Utf8Path, | |
experimental_full_html_support: bool, | |
) -> Result<Self, FileSourceError> { | |
if let Ok(file_source) = JsonFileSource::try_from_well_known(path) { | |
return Ok(file_source.into()); | |
} | |
if let Ok(file_source) = JsFileSource::try_from_well_known(path) { | |
return Ok(file_source.into()); | |
if experimental_full_html_support { | |
if let Ok(file_source) = HtmlFileSource::try_from_well_known(path) { | |
return Ok(file_source.into()); | |
} | |
if let Ok(file_source) = JsFileSource::try_from_well_known(path) { | |
return Ok(file_source.into()); | |
} | |
} else { | |
if let Ok(file_source) = JsFileSource::try_from_well_known(path) { | |
return Ok(file_source.into()); | |
} | |
if let Ok(file_source) = HtmlFileSource::try_from_well_known(path) { | |
return Ok(file_source.into()); | |
} | |
} | |
if let Ok(file_source) = CssFileSource::try_from_well_known(path) { | |
return Ok(file_source.into()); | |
} | |
if let Ok(file_source) = GraphqlFileSource::try_from_well_known(path) { | |
return Ok(file_source.into()); | |
} | |
if let Ok(file_source) = HtmlFileSource::try_from_well_known(path) { | |
return Ok(file_source.into()); | |
} | |
Err(FileSourceError::UnknownFileName) | |
} | |
/// Returns the document file source corresponding to this file name from well-known files | |
pub fn from_well_known(path: &Utf8Path) -> Self { | |
Self::try_from_well_known(path).unwrap_or(Self::Unknown) | |
} | |
pub fn from_well_known(path: &Utf8Path, experimental_full_html_support: bool) -> Self { | |
Self::try_from_well_known(path, experimental_full_html_support).unwrap_or(Self::Unknown) | |
} | |
/// Attempts to determine file source from well-known file patterns. | |
/// | |
/// # Arguments | |
/// | |
/// * `path` – The file path to check | |
/// * `experimental_full_html_support` – When `true`, prioritises HTML-ish language detection | |
/// (e.g., .vue, .astro, .svelte files are treated as HTML with embedded JS rather than JS with HTML templates) | |
fn try_from_well_known( | |
path: &Utf8Path, | |
experimental_full_html_support: bool, | |
) -> Result<Self, FileSourceError> { | |
if let Ok(file_source) = JsonFileSource::try_from_well_known(path) { | |
return Ok(file_source.into()); | |
} | |
if experimental_full_html_support { | |
if let Ok(file_source) = HtmlFileSource::try_from_well_known(path) { | |
return Ok(file_source.into()); | |
} | |
if let Ok(file_source) = JsFileSource::try_from_well_known(path) { | |
return Ok(file_source.into()); | |
} | |
} else { | |
if let Ok(file_source) = JsFileSource::try_from_well_known(path) { | |
return Ok(file_source.into()); | |
} | |
if let Ok(file_source) = HtmlFileSource::try_from_well_known(path) { | |
return Ok(file_source.into()); | |
} | |
} | |
if let Ok(file_source) = CssFileSource::try_from_well_known(path) { | |
return Ok(file_source.into()); | |
} | |
if let Ok(file_source) = GraphqlFileSource::try_from_well_known(path) { | |
return Ok(file_source.into()); | |
} | |
Err(FileSourceError::UnknownFileName) | |
} |
🤖 Prompt for AI Agents
In crates/biome_service/src/file_handlers/mod.rs around lines 130 to 166, the
boolean parameter experimental_full_html_support is undocumented; add a short
rustdoc comment above try_from_well_known (and mirror it above the public
from_well_known) that explains the parameter’s purpose (enables experimental
full HTML support), the behavior change it causes (when true, HTML takes
precedence over JS during file-source detection), the expected implications (may
change classification of ambiguous filenames and is experimental/subject to
change), and recommended usage (opt-in only when HTML-first detection is
desired). Ensure the docs mention the default/typical setting and that Unknown
is returned on failure as before.
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.
@coderabbitai This is a temporary change, and we will aim to remove it one the experimental support is stable. So it's OK if we decide to not update its docs
pub(crate) enabled_rules: &'a [AnalyzerSelector], | ||
pub(crate) plugins: AnalyzerPluginVec, | ||
pub(crate) categories: RuleCategories, | ||
pub(crate) action_offset: Option<TextSize>, |
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 call sites handle the new action_offset
field.
The addition of action_offset
to CodeActionsParams
requires all instantiation sites to provide a value. Ensure that all code action invocations across the codebase (particularly in the JS, CSS, JSON, and HTML file handlers) correctly populate this field.
Run the following script to find all instantiations of CodeActionsParams
:
🏁 Script executed:
#!/bin/bash
# Description: Find all instantiations of CodeActionsParams to verify action_offset handling
# Search for struct instantiation patterns
rg -nP --type=rust -C3 'CodeActionsParams\s*\{'
Length of output: 4043
Add action_offset
to all CodeActionsParams
instantiations
Every CodeActionsParams { parse, range, settings }
must now set action_offset
(e.g. action_offset: None
) to satisfy the new struct definition.
🤖 Prompt for AI Agents
In crates/biome_service/src/file_handlers/mod.rs around line 676, the
CodeActionsParams struct now includes a new field action_offset:
Option<TextSize>, but existing instantiations only use CodeActionsParams {
parse, range, settings }. Update every instantiation to include action_offset
(for now set to None where no offset is available) so they match the new struct
signature; i.e., add action_offset: None to each CodeActionsParams literal and
rebuild to ensure all occurrences are updated.
I think I understand what you mean, but could you provide an example to clarify it?
Done it. Added
Done. We skip it if there's SASS language |
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_syntax/src/element_ext.rs (1)
188-203
: Document breaking API change and bump major version
The return type ofis_typescript_lang
changed fromSyntaxResult<bool>
tobool
, which is a breaking change; update the CHANGELOG and bump the major version incrates/biome_html_syntax/Cargo.toml
.
🧹 Nitpick comments (1)
crates/biome_service/src/workspace.rs (1)
990-990
: Document the purpose of the offset field.The
CodeAction
struct now has anoffset: Option<TextSize>
field. Consider adding a doc comment explaining when this field is populated and how it's used, especially in the context of embedded HTML content.pub struct CodeAction { pub category: ActionCategory, pub rule_name: Option<(Cow<'static, str>, Cow<'static, str>)>, pub suggestion: CodeSuggestion, + /// Offset of the action within the parent document (used for embedded content) pub offset: Option<TextSize>, }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts
is excluded by!**/backend-jsonrpc/src/workspace.ts
and included by**
packages/@biomejs/biome/configuration_schema.json
is excluded by!**/configuration_schema.json
and included by**
📒 Files selected for processing (9)
crates/biome_formatter_test/src/spec.rs
(1 hunks)crates/biome_html_syntax/src/element_ext.rs
(4 hunks)crates/biome_ruledoc_utils/src/codeblock.rs
(2 hunks)crates/biome_service/src/file_handlers/html.rs
(11 hunks)crates/biome_service/src/file_handlers/svelte.rs
(1 hunks)crates/biome_service/src/file_handlers/vue.rs
(1 hunks)crates/biome_service/src/workspace.rs
(9 hunks)crates/biome_service/src/workspace/server.tests.rs
(4 hunks)crates/biome_test_utils/src/lib.rs
(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/biome_service/src/file_handlers/vue.rs
🧰 Additional context used
📓 Path-based instructions (5)
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_service/src/file_handlers/svelte.rs
crates/biome_service/src/workspace/server.tests.rs
crates/biome_html_syntax/src/element_ext.rs
crates/biome_test_utils/src/lib.rs
crates/biome_ruledoc_utils/src/codeblock.rs
crates/biome_service/src/workspace.rs
crates/biome_formatter_test/src/spec.rs
crates/biome_service/src/file_handlers/html.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Before committing, format Rust and TOML files (e.g., via
just f
/just format
)
Files:
crates/biome_service/src/file_handlers/svelte.rs
crates/biome_service/src/workspace/server.tests.rs
crates/biome_html_syntax/src/element_ext.rs
crates/biome_test_utils/src/lib.rs
crates/biome_ruledoc_utils/src/codeblock.rs
crates/biome_service/src/workspace.rs
crates/biome_formatter_test/src/spec.rs
crates/biome_service/src/file_handlers/html.rs
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Document rules, assists, and options via inline rustdoc in Rust source
Files:
crates/biome_service/src/file_handlers/svelte.rs
crates/biome_service/src/workspace/server.tests.rs
crates/biome_html_syntax/src/element_ext.rs
crates/biome_test_utils/src/lib.rs
crates/biome_ruledoc_utils/src/codeblock.rs
crates/biome_service/src/workspace.rs
crates/biome_formatter_test/src/spec.rs
crates/biome_service/src/file_handlers/html.rs
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**
📄 CodeRabbit inference engine (CLAUDE.md)
Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Files:
crates/biome_html_syntax/src/element_ext.rs
crates/biome_service/src/workspace.rs
📄 CodeRabbit inference engine (crates/biome_service/CONTRIBUTING.md)
Workspace
trait implementation entry point is located at src/workspace.rs
Files:
crates/biome_service/src/workspace.rs
🧠 Learnings (8)
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Expose a documented public function `format_node(options: HtmlFormatOptions, root: &HtmlSyntaxNode) -> FormatResult<Formatted<HtmlFormatContext>>` that calls `biome_formatter::format_node(root, HtmlFormatLanguage::new(options))`
Applied to files:
crates/biome_service/src/file_handlers/svelte.rs
crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-02T13:00:18.243Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T13:00:18.243Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Watcher workspace-method tests reside in src/workspace/watcher.tests.rs
Applied to files:
crates/biome_service/src/workspace/server.tests.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/language.rs : Create `HtmlTestFormatLanguage` and implement the `TestFormatLanguage` trait
Applied to files:
crates/biome_formatter_test/src/spec.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_tests.rs : Configure test generation using `tests_macros::gen_tests! {"tests/specs/html/**/*.html", crate::spec_test::run, ""}` inside a formatter::html_module module
Applied to files:
crates/biome_formatter_test/src/spec.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_test.rs : Provide a `run` function that builds a SpecSnapshot with HtmlFormatLanguage and HtmlTestFormatLanguage and calls `snapshot.test()`
Applied to files:
crates/biome_formatter_test/src/spec.rs
📚 Learning: 2025-08-17T08:55:30.118Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-17T08:55:30.118Z
Learning: Applies to crates/biome_html_formatter/benches/html_formatter.rs : Maintain the HTML formatter benchmark at benches/html_formatter.rs within the biome_html_formatter crate
Applied to files:
crates/biome_formatter_test/src/spec.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Implement `FormatLanguage` for `HtmlFormatLanguage` with associated types: `SyntaxLanguage = HtmlLanguage`, `Context = HtmlFormatContext`, `FormatRule = FormatHtmlSyntaxNode`
Applied to files:
crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-02T12:58:00.914Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:00.914Z
Learning: Applies to crates/biome_js_formatter/src/**/*.rs : Import and implement the FormatNode trait for your node types
Applied to files:
crates/biome_service/src/file_handlers/html.rs
🧬 Code graph analysis (7)
crates/biome_service/src/file_handlers/svelte.rs (1)
crates/biome_ruledoc_utils/src/codeblock.rs (1)
document_file_source
(96-98)
crates/biome_html_syntax/src/element_ext.rs (2)
crates/biome_html_syntax/src/lib.rs (1)
inner_string_text
(119-128)crates/biome_html_syntax/src/generated/nodes.rs (6)
value
(165-167)value_token
(201-203)value_token
(331-333)value_token
(526-528)value_token
(766-768)value_token
(801-803)
crates/biome_test_utils/src/lib.rs (1)
crates/biome_service/src/file_handlers/mod.rs (2)
from_path
(283-285)from_well_known
(164-166)
crates/biome_ruledoc_utils/src/codeblock.rs (1)
crates/biome_service/src/file_handlers/mod.rs (1)
from_extension
(207-209)
crates/biome_service/src/workspace.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (3)
SupportKind
(22-27)FeatureKind
(11-17)TextSize
(9289-9289)
crates/biome_formatter_test/src/spec.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
DocumentFileSource
(9413-9421)crates/biome_formatter_test/src/test_prettier_snapshot.rs (1)
input_file
(56-58)
crates/biome_service/src/file_handlers/html.rs (5)
crates/biome_js_parser/src/parse.rs (5)
parse_js_with_offset_and_cache
(396-409)parse
(187-192)parse
(233-234)parse
(261-264)cast
(37-43)crates/biome_rowan/src/ast/mod.rs (1)
cast_ref
(142-151)crates/biome_html_syntax/src/generated/nodes.rs (21)
content
(81-83)cast
(1015-1021)cast
(1065-1071)cast
(1120-1126)cast
(1171-1177)cast
(1219-1225)cast
(1269-1275)cast
(1327-1333)cast
(1386-1392)cast
(1436-1442)cast
(1511-1517)cast
(1566-1572)cast
(1621-1627)cast
(1671-1677)cast
(1727-1733)cast
(1787-1793)value_token
(201-203)value_token
(331-333)value_token
(526-528)value_token
(766-768)value_token
(801-803)crates/biome_js_syntax/src/file_source.rs (2)
ts
(173-180)js_module
(158-160)crates/biome_html_syntax/src/element_ext.rs (1)
value_token
(295-300)
⏰ 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). (11)
- GitHub Check: autofix
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Documentation
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_formatter)
🔇 Additional comments (21)
crates/biome_service/src/file_handlers/svelte.rs (1)
151-151
: LGTM! Consistent refactor.The change to pass
document_file_source
directly (instead of converting viato_htmlish()
) aligns with the broader pattern established across Vue, Astro and other handlers in this PR. The new signature properly supports the feature-flagged HTML implementation.crates/biome_service/src/workspace/server.tests.rs (3)
273-273
: LGTM: API update correctly applied.Both calls now pass
false
for the experimental HTML support flag, which is correct for these JSX-focused tests.Also applies to: 282-282
385-385
: LGTM: Consistent parameter addition.These calls also correctly pass
false
for the experimental flag, maintaining consistency with the rest of the file.Also applies to: 394-394
273-273
: Consider adding tests for the experimental HTML support feature.Whilst the updated calls are correct, this file lacks test cases that exercise the new
experimental_full_html_support
flag withtrue
. Given that this PR introduces full experimental support for HTML-ish languages, tests verifying behaviour differences between enabled/disabled states would strengthen coverage.Would you like me to generate test cases that verify the experimental HTML full support feature, or is this coverage planned elsewhere?
Also applies to: 282-282, 385-385, 394-394
crates/biome_ruledoc_utils/src/codeblock.rs (1)
97-97
: LGTM: Experimental flag disabled for doc tests.Passing
false
for the experimental HTML support flag in documentation utilities is appropriate. Doc tests should use stable behaviour by default.Also applies to: 141-142
crates/biome_service/src/workspace.rs (4)
134-141
: LGTM: Constants updated consistently.
NUM_FEATURE_KINDS
andWORKSPACE_FEATURES
array correctly expanded to accommodate the newHtmlFullSupport
feature.Also applies to: 555-555
277-280
: LGTM: Helper method follows existing pattern.The
supports_full_html_support()
method follows the same pattern as other feature support checks.
551-552
: LGTM: HtmlFullSupport properly integrated.The new
HtmlFullSupport
variant is correctly integrated across all feature handling paths: enum declaration, Display impl, index mappings, and Debug impl.Also applies to: 565-565, 583-583, 597-597, 626-626
222-226
: Resolved:experimental_full_html_support
is defined onSettings
(Option) and is correctly populated from your configuration loader.crates/biome_formatter_test/src/spec.rs (1)
283-289
: LGTM: Experimental flag correctly propagated in tests.The test now constructs
DocumentFileSource
with the experimental flag from settings, ensuring test formatting behaviour matches the configured experimental features.crates/biome_test_utils/src/lib.rs (2)
89-92
: LGTM: Experimental flag from settings.Both
from_path
calls correctly retrieve the experimental flag from settings, ensuring test utilities respect the configured behaviour.Also applies to: 136-139
200-200
: LGTM: Hardcoded false appropriate for file discovery.Using
false
for the experimental flag infrom_well_known
during file discovery is appropriate—this path is collecting JavaScript-like files and doesn't need experimental features enabled.crates/biome_html_syntax/src/element_ext.rs (1)
290-301
: LGTM! The union and delegation look sound.The
AnyEmbeddedContent
union properly combines the two embedded content variants, and thevalue_token
method delegates appropriately to each variant's token accessor.crates/biome_service/src/file_handlers/html.rs (8)
39-44
: LGTM!The imports properly support the new Astro embedding functionality.
397-407
: LGTM!The Astro embedded content path is correctly positioned before
HtmlElement
casting and follows the established pattern for embedded node processing.
441-468
: Verify the hardcoded TypeScript assumption.Line 448: The function always creates
JsFileSource::ts()
for Astro frontmatter. Whilst TypeScript is common in Astro, frontmatter can also be plain JavaScript. Consider whether language detection (similar tois_typescript_lang
in other contexts) is needed, or document this limitation in the experimental support.Do you want language detection for Astro frontmatter, or is TypeScript-only acceptable for this experimental feature?
479-490
: LGTM!The embedding kind logic for Svelte and Vue is correctly structured, and the usage of
is_typescript_lang()
is now consistent with its new signature.
546-549
: LGTM!The SASS guard prevents unsupported languages from being parsed as CSS, aligning with the PR objectives.
777-777
: LGTM!The
action_offset
field is properly extracted and propagated to eachCodeAction
item, supporting offset-aware code actions for embedded content.Also applies to: 815-815
938-938
: LGTM!Disabling embedding during
fix_all
formatting is appropriate here to avoid re-processing embedded nodes.
966-979
: LGTM!The switch to
AnyEmbeddedContent
and the optionalvalue_token
handling correctly support both HTML and Astro embedded content in snippet updates.
let is_lang_typescript = lang_attribute.is_some_and(|attribute| { | ||
attribute | ||
.initializer() | ||
.and_then(|initializer| initializer.value().ok()) | ||
.and_then(|value| value.as_html_string().cloned()) | ||
.and_then(|value| value.value_token().ok()) | ||
.is_some_and(|token| { | ||
let text = inner_string_text(&token); | ||
text.eq_ignore_ascii_case("sass") || text.eq_ignore_ascii_case("scss") | ||
}) | ||
}); | ||
is_style && is_lang_typescript |
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.
Misleading variable name.
Line 209: The variable is named is_lang_typescript
but checks for sass
or scss
. Rename it to is_lang_sass
for clarity.
Apply this diff:
- let is_lang_typescript = lang_attribute.is_some_and(|attribute| {
+ let is_lang_sass = lang_attribute.is_some_and(|attribute| {
attribute
.initializer()
.and_then(|initializer| initializer.value().ok())
.and_then(|value| value.as_html_string().cloned())
.and_then(|value| value.value_token().ok())
.is_some_and(|token| {
let text = inner_string_text(&token);
text.eq_ignore_ascii_case("sass") || text.eq_ignore_ascii_case("scss")
})
});
- is_style && is_lang_typescript
+ is_style && is_lang_sass
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
let is_lang_typescript = lang_attribute.is_some_and(|attribute| { | |
attribute | |
.initializer() | |
.and_then(|initializer| initializer.value().ok()) | |
.and_then(|value| value.as_html_string().cloned()) | |
.and_then(|value| value.value_token().ok()) | |
.is_some_and(|token| { | |
let text = inner_string_text(&token); | |
text.eq_ignore_ascii_case("sass") || text.eq_ignore_ascii_case("scss") | |
}) | |
}); | |
is_style && is_lang_typescript | |
let is_lang_sass = lang_attribute.is_some_and(|attribute| { | |
attribute | |
.initializer() | |
.and_then(|initializer| initializer.value().ok()) | |
.and_then(|value| value.as_html_string().cloned()) | |
.and_then(|value| value.value_token().ok()) | |
.is_some_and(|token| { | |
let text = inner_string_text(&token); | |
text.eq_ignore_ascii_case("sass") || text.eq_ignore_ascii_case("scss") | |
}) | |
}); | |
is_style && is_lang_sass |
🤖 Prompt for AI Agents
In crates/biome_html_syntax/src/element_ext.rs around lines 209 to 220 the
boolean variable is_lang_typescript is misnamed because the predicate checks for
"sass" or "scss"; rename the variable to is_lang_sass (and update any subsequent
references on these lines) so the name matches the check, keeping the logic
unchanged.
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: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (7)
crates/biome_service/src/file_handlers/json.rs (1)
561-577
: Compile error: using movedparams
after destructuring.You destructure
params
into locals but still referenceparams.path
,params.language
, andparams.settings
below. Use the local bindings.Apply:
- let analyzer_options = workspace.analyzer_options::<JsonLanguage>( - params.path, - ¶ms.language, - suppression_reason.as_deref(), - ); + let analyzer_options = workspace.analyzer_options::<JsonLanguage>( + path, + &language, + suppression_reason.as_deref(), + );And a bit further down:
- let (enabled_rules, disabled_rules, analyzer_options) = - AnalyzerVisitorBuilder::new(params.settings, analyzer_options) + let (enabled_rules, disabled_rules, analyzer_options) = + AnalyzerVisitorBuilder::new(workspace, analyzer_options) .with_only(only) .with_skip(skip) - .with_path(params.path.as_path()) + .with_path(path.as_path()) .with_enabled_selectors(rules) .with_project_layout(project_layout) .finish();crates/biome_service/src/file_handlers/svelte.rs (1)
151-156
: Convert to an HTML file source before resolving HTML options.- let html_options = settings.format_options::<HtmlLanguage>(biome_path, &document_file_source); + let html_source = document_file_source + .to_html_file_source() + .unwrap_or_default() + .into(); + let html_options = settings.format_options::<HtmlLanguage>(biome_path, &html_source);crates/biome_service/src/settings.rs (1)
1903-1913
: HTML overrides don’t propagate parser/linter/assist — html.interpolation won’t work in overridesto_html_language_settings only maps the formatter. However, apply_overrides_to_html_parser_options reads from self.languages.html.parser. As-is, overrides like html.parser.interpolation are ignored. Map parser (and align enabled flags for linter/assist) like other languages.
Apply this diff:
fn to_html_language_settings( - mut conf: HtmlConfiguration, - _parent_settings: &LanguageSettings<HtmlLanguage>, + mut conf: HtmlConfiguration, + parent_settings: &LanguageSettings<HtmlLanguage>, ) -> LanguageSettings<HtmlLanguage> { let mut language_setting: LanguageSettings<HtmlLanguage> = LanguageSettings::default(); - let formatter = conf.formatter.take().unwrap_or_default(); - - language_setting.formatter = formatter.into(); - - language_setting + let formatter = conf.formatter.take().unwrap_or_default(); + language_setting.formatter = formatter.into(); + + // Propagate parser options (e.g. interpolation) into overrides + let parser = conf.parser.take().unwrap_or_default(); + let parent_parser = &parent_settings.parser; + language_setting.parser.interpolation = + parser.interpolation.or(parent_parser.interpolation); + + // Keep override parity with other languages: carry enabled flags + let linter = conf.linter.take().unwrap_or_default(); + language_setting.linter.enabled = linter.enabled; + + let assist = conf.assist.take().unwrap_or_default(); + language_setting.assist.enabled = assist.enabled; + + language_setting }This makes overrides for html.parser.interpolation effective and aligns with JS/CSS/GraphQL override handling. As per coding guidelines.
Also applies to: 1678-1684
crates/biome_lsp/src/handlers/analysis.rs (1)
118-129
: Gate offset logic to legacy mode and pass it through to fix_allWith full HTML support, cursor ranges should be used as-is. Keep offset extraction and range normalisation only when not in full mode, and forward the offset into fix_all for legacy embedding so diagnostics align.
Apply this diff:
let content = session.workspace.get_file_content(GetFileContentParams { project_key: doc.project_key, path: path.clone(), })?; - let offset = match path.extension() { - Some("vue") => VueFileHandler::start(content.as_str()), - Some("astro") => AstroFileHandler::start(content.as_str()), - Some("svelte") => SvelteFileHandler::start(content.as_str()), - _ => None, - }; + let offset = if file_features.supports_full_html_support() { + None + } else { + match path.extension() { + Some("vue") => VueFileHandler::start(content.as_str()), + Some("astro") => AstroFileHandler::start(content.as_str()), + Some("svelte") => SvelteFileHandler::start(content.as_str()), + _ => None, + } + }; @@ - let fix_all = if has_fix_all { - fix_all(session, &url, path, &doc.line_index, &diagnostics, None)? + let fix_all = if has_fix_all { + fix_all(session, &url, path, &doc.line_index, &diagnostics, offset)? } else { None };This prevents double-shifting in full support and restores correct mapping in legacy mode.
Also applies to: 139-150, 186-186
crates/biome_lsp/src/handlers/formatting.rs (1)
169-187
: Range formatting should gate offset logic like format()When full HTML support is enabled, the formatter operates on the whole document; subtracting the script offset will skew ranges. Gate offset extraction and subtraction behind supports_full_html_support().
Apply this diff:
- let offset = match path.extension() { - Some("vue") => VueFileHandler::start(content.as_str()), - Some("astro") => AstroFileHandler::start(content.as_str()), - Some("svelte") => SvelteFileHandler::start(content.as_str()), - _ => None, - }; + let offset = if file_features.supports_full_html_support() { + None + } else { + match path.extension() { + Some("vue") => VueFileHandler::start(content.as_str()), + Some("astro") => AstroFileHandler::start(content.as_str()), + Some("svelte") => SvelteFileHandler::start(content.as_str()), + _ => None, + } + };crates/biome_service/src/workspace/server.rs (1)
241-256
: Consider consistency in error reporting.In
build_capability_error
, you've hardcodedexperimental_full_html_support
tofalse
(line 247) with a comment about simplicity. However, this could produce misleading error messages when the experimental feature is enabled, as the error would report capabilities based on a different file source determination than what was actually used during processing.Would it be more correct to accept the actual flag value used, or retrieve it from settings within the closure?
crates/biome_service/src/file_handlers/mod.rs (1)
168-209
: Verify the JSON ordering logic.In
try_from_extension
, whenexperimental_full_html_support
istrue
, you check HTML before JSON (lines 174-179), but whenfalse
, you check JSON before HTML (lines 181-187). This ordering change seems unintended—the JSON vs HTML priority shouldn't depend on the experimental HTML-ish language support flag, should it?The HTML vs JS ordering makes sense (prioritize HTML parser for
.vue
/.svelte
/.astro
when experimental flag is enabled), but the JSON ordering shift could be a subtle bug.Apply this diff to preserve JSON priority regardless of the experimental flag:
fn try_from_extension( extension: &str, experimental_full_html_support: bool, ) -> Result<Self, FileSourceError> { - // Order here is important + if let Ok(file_source) = JsonFileSource::try_from_extension(extension) { + return Ok(file_source.into()); + } + if experimental_full_html_support { if let Ok(file_source) = HtmlFileSource::try_from_extension(extension) { return Ok(file_source.into()); } - if let Ok(file_source) = JsonFileSource::try_from_extension(extension) { - return Ok(file_source.into()); - } + if let Ok(file_source) = JsFileSource::try_from_extension(extension) { + return Ok(file_source.into()); + } } else { - if let Ok(file_source) = JsonFileSource::try_from_extension(extension) { + if let Ok(file_source) = JsFileSource::try_from_extension(extension) { return Ok(file_source.into()); } if let Ok(file_source) = HtmlFileSource::try_from_extension(extension) { return Ok(file_source.into()); } } - if let Ok(file_source) = JsFileSource::try_from_extension(extension) { - return Ok(file_source.into()); - } if let Ok(file_source) = CssFileSource::try_from_extension(extension) { return Ok(file_source.into()); }
♻️ Duplicate comments (2)
.changeset/upset-impalas-grab.md (1)
12-12
: Clarify “fine-parsed”.Could we swap “fine-parsed” for something clearer like “correctly parsed”? Keeps the sentence precise.
.changeset/wise-forks-hide.md (1)
7-16
: Pop a full stop on that sentence.As noted earlier, end the sentence with a full stop.
-The following `file.html` will be correctly formatted: +The following `file.html` will be correctly formatted.
🧹 Nitpick comments (8)
crates/biome_service/src/diagnostics.rs (1)
516-516
: Don’t hard‑code experimental flag in from_path.Hard‑coding false may misclassify .astro/.vue/.svelte when full HTML support is enabled, yielding misleading “unknown language” diagnostics. Propagate the experimental flag from the caller or accept a precomputed DocumentFileSource.
Example direction (one of):
- Change signature: extension_error(path, experimental_full_html_support)
- Or add: extension_error_with_features(path, experimental_full_html_support)
- Or accept DocumentFileSource directly
crates/biome_cli/src/execute/std_in.rs (1)
81-90
: LGTM; consider DRYing the wrapper logic.The three extension guards are correct, but duplicated. A tiny helper reduces churn:
let wrap_output = |input: &str, code: String| { if !file_features.supports_full_html_support() { match biome_path.extension() { Some("astro") => AstroFileHandler::output(input, &code), Some("vue") => VueFileHandler::output(input, &code), Some("svelte") => SvelteFileHandler::output(input, &code), _ => code, } } else { code } };Then call
wrap_output(content, code)
/wrap_output(&new_content, code)
accordingly.Also applies to: 181-190, 209-218
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs (1)
15-21
: Frontmatter always adds a blank line; check desired spacing.With content always formatted plus a hard line break, empty frontmatter now yields a blank line between fences. If that’s intended, great; if not, guard the extra line break on non‑empty content.
Optionally:
- write!(f, [content.format(), hard_line_break()])?; + write!(f, [content.format()])?; + // Add a newline only when content isn’t empty + if !node.content()?.syntax().text().is_empty() { + write!(f, [hard_line_break()])?; + }crates/biome_cli/tests/cases/handle_svelte_files.rs (2)
226-262
: Maybe drop the “astro” ghostsLooks like we copy-pasted from the Astro test and left the
astro_file_path
name behind even though we’re wiring upfile.svelte
. Not wrong, but it’ll raise eyebrows for the next reader. Fancy renaming it tosvelte_file_path
so the variable tells the truth?
274-315
: Same ghost hereSame deal in the TS variant: keeping the variable name aligned with the file type will save the next maintainer a head tilt. Mind giving it the Svelte treatment too?
crates/biome_cli/src/execute/process_file/format.rs (2)
95-118
: Avoid writing empty output; mirror LSP safeguardCurrently, empty-output early-return happens only for astro/vue/svelte when full support is off. If full support is on and the printer ever returns an empty string, the CLI could write an empty file. Add a single early-return after into_code() and drop the per-arm checks.
Apply within this block to remove duplicated emptiness checks:
- Some("astro") => { - if output.is_empty() { - return Ok(FileStatus::Unchanged); - } - output = AstroFileHandler::output(input.as_str(), output.as_str()); - } + Some("astro") => { + output = AstroFileHandler::output(input.as_str(), output.as_str()); + } Some("vue") => { - if output.is_empty() { - return Ok(FileStatus::Unchanged); - } output = VueFileHandler::output(input.as_str(), output.as_str()); } Some("svelte") => { - if output.is_empty() { - return Ok(FileStatus::Unchanged); - } output = SvelteFileHandler::output(input.as_str(), output.as_str()); }And add this guard just after into_code() (outside the selected range):
// Early-out to avoid writing empty content (mirrors LSP behaviour) if output.is_empty() { return Ok(FileStatus::Unchanged); }
16-16
: Tracing: skip features_supported in spanTiny nit: avoid logging the full features struct by adding it to skip list.
-#[instrument(name = "cli_format", level = "debug", skip(ctx, path))] +#[instrument(name = "cli_format", level = "debug", skip(ctx, path, features_supported))]crates/biome_cli/src/execute/process_file/lint_and_assist.rs (1)
100-113
: Per-extension output remap gated correctlyGood: only remap when full HTML support is off. Mirrors format.rs.
Consider extracting this “per-extension output mapping” into a small helper to avoid duplication across CLI format and lint paths.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (40)
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/check_stdin_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/check_stdin_write_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/check_stdin_write_unsafe_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/format_astro_carriage_return_line_feed_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/format_empty_astro_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/format_stdin_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/full_support.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/lint_and_fix_astro_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/lint_astro_files.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/lint_stdin_write_unsafe_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/sorts_imports_check.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/sorts_imports_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/full_support.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/full_support_ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/lint_stdin_write_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/sorts_imports_check.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/format_empty_vue_js_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/format_empty_vue_ts_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/full_support.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/full_support_ts.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/lint_stdin_write_successfully.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/sorts_imports_check.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/format_empty_svelte_js_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/format_empty_svelte_ts_files_write.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/html_disabled_by_default.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/html_enabled_by_default.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_factory/src/generated/node_factory.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
crates/biome_html_factory/src/generated/syntax_factory.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
crates/biome_html_parser/tests/html_specs/error/astro/attribute_expression.astro.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_parser/tests/html_specs/error/frontmatter.html.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_parser/tests/html_specs/error/frontmatter_bogus.html.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_parser/tests/html_specs/error/missing_fence.astro.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_parser/tests/html_specs/ok/astro/attribute_expression.astro.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_parser/tests/html_specs/ok/with_fence.astro.snap
is excluded by!**/*.snap
and included by**
crates/biome_html_syntax/src/generated/kind.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
crates/biome_html_syntax/src/generated/macros.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
crates/biome_html_syntax/src/generated/nodes.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
crates/biome_html_syntax/src/generated/nodes_mut.rs
is excluded by!**/generated/**
,!**/generated/**
and included by**
packages/@biomejs/backend-jsonrpc/src/workspace.ts
is excluded by!**/backend-jsonrpc/src/workspace.ts
and included by**
packages/@biomejs/biome/configuration_schema.json
is excluded by!**/configuration_schema.json
and included by**
📒 Files selected for processing (44)
.changeset/stupid-groups-grow.md
(1 hunks).changeset/upset-impalas-grab.md
(1 hunks).changeset/wise-forks-hide.md
(1 hunks)crates/biome_cli/src/execute/process_file.rs
(1 hunks)crates/biome_cli/src/execute/process_file/check.rs
(3 hunks)crates/biome_cli/src/execute/process_file/format.rs
(3 hunks)crates/biome_cli/src/execute/process_file/lint_and_assist.rs
(6 hunks)crates/biome_cli/src/execute/process_file/search.rs
(1 hunks)crates/biome_cli/src/execute/std_in.rs
(3 hunks)crates/biome_cli/tests/cases/handle_astro_files.rs
(2 hunks)crates/biome_cli/tests/cases/handle_svelte_files.rs
(1 hunks)crates/biome_cli/tests/cases/handle_vue_files.rs
(2 hunks)crates/biome_cli/tests/cases/indent_script_and_style.rs
(1 hunks)crates/biome_cli/tests/commands/format.rs
(2 hunks)crates/biome_configuration/src/html.rs
(2 hunks)crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
(1 hunks)crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs
(1 hunks)crates/biome_html_formatter/src/astro/auxiliary/mod.rs
(1 hunks)crates/biome_html_formatter/src/generated.rs
(1 hunks)crates/biome_html_parser/src/syntax/astro.rs
(2 hunks)crates/biome_html_syntax/src/element_ext.rs
(2 hunks)crates/biome_html_syntax/src/file_source.rs
(1 hunks)crates/biome_js_analyze/tests/spec_tests.rs
(2 hunks)crates/biome_js_syntax/src/file_source.rs
(3 hunks)crates/biome_lsp/src/handlers/analysis.rs
(4 hunks)crates/biome_lsp/src/handlers/formatting.rs
(3 hunks)crates/biome_lsp/src/server.tests.rs
(1 hunks)crates/biome_lsp/src/session.rs
(2 hunks)crates/biome_lsp/src/utils.rs
(1 hunks)crates/biome_service/src/diagnostics.rs
(1 hunks)crates/biome_service/src/file_handlers/css.rs
(2 hunks)crates/biome_service/src/file_handlers/graphql.rs
(2 hunks)crates/biome_service/src/file_handlers/html.rs
(9 hunks)crates/biome_service/src/file_handlers/javascript.rs
(2 hunks)crates/biome_service/src/file_handlers/json.rs
(2 hunks)crates/biome_service/src/file_handlers/mod.rs
(12 hunks)crates/biome_service/src/file_handlers/svelte.rs
(1 hunks)crates/biome_service/src/file_handlers/vue.rs
(1 hunks)crates/biome_service/src/settings.rs
(4 hunks)crates/biome_service/src/workspace.rs
(9 hunks)crates/biome_service/src/workspace/server.rs
(25 hunks)xtask/codegen/html.ungram
(1 hunks)xtask/codegen/src/html_kinds_src.rs
(1 hunks)xtask/rules_check/src/lib.rs
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (9)
- crates/biome_html_formatter/src/astro/auxiliary/mod.rs
- crates/biome_service/src/file_handlers/javascript.rs
- crates/biome_js_syntax/src/file_source.rs
- .changeset/stupid-groups-grow.md
- crates/biome_service/src/workspace.rs
- crates/biome_js_analyze/tests/spec_tests.rs
- crates/biome_lsp/src/server.tests.rs
- crates/biome_html_syntax/src/file_source.rs
- crates/biome_cli/tests/commands/format.rs
🧰 Additional context used
📓 Path-based instructions (8)
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_service/src/diagnostics.rs
crates/biome_cli/src/execute/std_in.rs
crates/biome_cli/src/execute/process_file/search.rs
crates/biome_lsp/src/handlers/analysis.rs
crates/biome_cli/tests/cases/handle_vue_files.rs
crates/biome_service/src/file_handlers/svelte.rs
crates/biome_lsp/src/utils.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_cli/src/execute/process_file/check.rs
crates/biome_html_syntax/src/element_ext.rs
crates/biome_lsp/src/handlers/formatting.rs
crates/biome_html_formatter/src/generated.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
crates/biome_service/src/settings.rs
crates/biome_lsp/src/session.rs
crates/biome_service/src/file_handlers/vue.rs
crates/biome_service/src/workspace/server.rs
crates/biome_cli/src/execute/process_file.rs
crates/biome_html_parser/src/syntax/astro.rs
crates/biome_cli/src/execute/process_file/lint_and_assist.rs
crates/biome_service/src/file_handlers/css.rs
crates/biome_configuration/src/html.rs
crates/biome_cli/tests/cases/handle_astro_files.rs
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs
crates/biome_service/src/file_handlers/json.rs
crates/biome_service/src/file_handlers/mod.rs
crates/biome_service/src/file_handlers/html.rs
crates/biome_cli/tests/cases/handle_svelte_files.rs
crates/biome_cli/src/execute/process_file/format.rs
crates/biome_service/src/file_handlers/graphql.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Before committing, format Rust and TOML files (e.g., via
just f
/just format
)
Files:
crates/biome_service/src/diagnostics.rs
crates/biome_cli/src/execute/std_in.rs
crates/biome_cli/src/execute/process_file/search.rs
crates/biome_lsp/src/handlers/analysis.rs
crates/biome_cli/tests/cases/handle_vue_files.rs
xtask/rules_check/src/lib.rs
crates/biome_service/src/file_handlers/svelte.rs
crates/biome_lsp/src/utils.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_cli/src/execute/process_file/check.rs
xtask/codegen/src/html_kinds_src.rs
crates/biome_html_syntax/src/element_ext.rs
crates/biome_lsp/src/handlers/formatting.rs
crates/biome_html_formatter/src/generated.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
crates/biome_service/src/settings.rs
crates/biome_lsp/src/session.rs
crates/biome_service/src/file_handlers/vue.rs
crates/biome_service/src/workspace/server.rs
crates/biome_cli/src/execute/process_file.rs
crates/biome_html_parser/src/syntax/astro.rs
crates/biome_cli/src/execute/process_file/lint_and_assist.rs
crates/biome_service/src/file_handlers/css.rs
crates/biome_configuration/src/html.rs
crates/biome_cli/tests/cases/handle_astro_files.rs
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs
crates/biome_service/src/file_handlers/json.rs
crates/biome_service/src/file_handlers/mod.rs
crates/biome_service/src/file_handlers/html.rs
crates/biome_cli/tests/cases/handle_svelte_files.rs
crates/biome_cli/src/execute/process_file/format.rs
crates/biome_service/src/file_handlers/graphql.rs
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Document rules, assists, and options via inline rustdoc in Rust source
Files:
crates/biome_service/src/diagnostics.rs
crates/biome_cli/src/execute/std_in.rs
crates/biome_cli/src/execute/process_file/search.rs
crates/biome_lsp/src/handlers/analysis.rs
crates/biome_cli/tests/cases/handle_vue_files.rs
xtask/rules_check/src/lib.rs
crates/biome_service/src/file_handlers/svelte.rs
crates/biome_lsp/src/utils.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_cli/src/execute/process_file/check.rs
xtask/codegen/src/html_kinds_src.rs
crates/biome_html_syntax/src/element_ext.rs
crates/biome_lsp/src/handlers/formatting.rs
crates/biome_html_formatter/src/generated.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
crates/biome_service/src/settings.rs
crates/biome_lsp/src/session.rs
crates/biome_service/src/file_handlers/vue.rs
crates/biome_service/src/workspace/server.rs
crates/biome_cli/src/execute/process_file.rs
crates/biome_html_parser/src/syntax/astro.rs
crates/biome_cli/src/execute/process_file/lint_and_assist.rs
crates/biome_service/src/file_handlers/css.rs
crates/biome_configuration/src/html.rs
crates/biome_cli/tests/cases/handle_astro_files.rs
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs
crates/biome_service/src/file_handlers/json.rs
crates/biome_service/src/file_handlers/mod.rs
crates/biome_service/src/file_handlers/html.rs
crates/biome_cli/tests/cases/handle_svelte_files.rs
crates/biome_cli/src/execute/process_file/format.rs
crates/biome_service/src/file_handlers/graphql.rs
**/tests/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place test files under a tests/ directory in each crate
Files:
crates/biome_cli/tests/cases/handle_vue_files.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
crates/biome_cli/tests/cases/handle_astro_files.rs
crates/biome_cli/tests/cases/handle_svelte_files.rs
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**
📄 CodeRabbit inference engine (CLAUDE.md)
Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Files:
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_html_syntax/src/element_ext.rs
crates/biome_html_formatter/src/generated.rs
crates/biome_html_parser/src/syntax/astro.rs
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs
xtask/codegen/*.ungram
📄 CodeRabbit inference engine (CLAUDE.md)
Define and modify language grammars in .ungram files; ASTs are generated from these
Files:
xtask/codegen/html.ungram
.changeset/**/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/**/*.md
: Create changesets using thejust new-changeset
command; do not author them manually
In changeset markdown, only use headers #### or #####
Changeset descriptions must end every sentence with a full stop (.)
For bug fixes, start the changeset description with a linked issue reference like “Fixed #1234”
Prefer past tense for what was done and present tense for current behavior in changesets
Files:
.changeset/wise-forks-hide.md
.changeset/upset-impalas-grab.md
crates/biome_configuration/src/**
📄 CodeRabbit inference engine (CLAUDE.md)
Keep configuration sources under biome_configuration/src/
Files:
crates/biome_configuration/src/html.rs
🧠 Learnings (18)
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_test.rs : Provide a `run` function that builds a SpecSnapshot with HtmlFormatLanguage and HtmlTestFormatLanguage and calls `snapshot.test()`
Applied to files:
crates/biome_cli/tests/cases/handle_vue_files.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
📚 Learning: 2025-08-17T08:55:30.118Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-17T08:55:30.118Z
Learning: Applies to **/tests/specs/**/*.snap : Use snapshot spec tests stored as .snap files under tests/specs/ (via cargo insta)
Applied to files:
crates/biome_cli/tests/cases/handle_vue_files.rs
crates/biome_cli/tests/cases/indent_script_and_style.rs
📚 Learning: 2025-08-17T08:55:30.118Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-17T08:55:30.118Z
Learning: Applies to crates/biome_html_formatter/benches/html_formatter.rs : Maintain the HTML formatter benchmark at benches/html_formatter.rs within the biome_html_formatter crate
Applied to files:
crates/biome_service/src/file_handlers/svelte.rs
crates/biome_service/src/file_handlers/vue.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Expose a documented public function `format_node(options: HtmlFormatOptions, root: &HtmlSyntaxNode) -> FormatResult<Formatted<HtmlFormatContext>>` that calls `biome_formatter::format_node(root, HtmlFormatLanguage::new(options))`
Applied to files:
crates/biome_service/src/file_handlers/svelte.rs
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_html_formatter/src/generated.rs
crates/biome_service/src/file_handlers/vue.rs
crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/cst.rs : Create FormatHtmlSyntaxNode and implement `FormatRule<HtmlSyntaxNode>` plus `AsFormat<HtmlFormatContext>` and `IntoFormat<HtmlFormatContext>` for HtmlSyntaxNode using the provided mapping code
Applied to files:
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_html_formatter/src/generated.rs
crates/biome_html_parser/src/syntax/astro.rs
📚 Learning: 2025-10-02T12:58:00.914Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:00.914Z
Learning: Applies to crates/biome_js_formatter/src/**/*.rs : Implement the Format trait for your AST nodes using biome_js_formatter (use biome_js_formatter::prelude::*, write!, token, dynamic_token, etc.)
Applied to files:
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_html_formatter/src/generated.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Implement `FormatLanguage` for `HtmlFormatLanguage` with associated types: `SyntaxLanguage = HtmlLanguage`, `Context = HtmlFormatContext`, `FormatRule = FormatHtmlSyntaxNode`
Applied to files:
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_html_formatter/src/generated.rs
crates/biome_service/src/file_handlers/vue.rs
crates/biome_html_parser/src/syntax/astro.rs
crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-02T12:58:00.914Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:00.914Z
Learning: Applies to crates/biome_js_formatter/src/**/*.rs : Import and implement the FormatNode trait for your node types
Applied to files:
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_html_formatter/src/generated.rs
crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-02T12:58:00.914Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:00.914Z
Learning: Applies to crates/biome_js_formatter/src/**/*.rs : When a token is mandatory and present in the AST, format using the node’s token accessor (e.g., node.l_paren_token().format()) instead of hardcoding the token
Applied to files:
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs
📚 Learning: 2025-10-02T13:00:04.826Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T13:00:04.826Z
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_syntax/src/element_ext.rs
📚 Learning: 2025-10-02T13:00:18.243Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T13:00:18.243Z
Learning: Applies to crates/biome_service/**/biome_lsp/src/server.tests.rs : End-to-end LSP tests reside in biome_lsp/src/server.tests.rs
Applied to files:
crates/biome_lsp/src/handlers/formatting.rs
crates/biome_cli/tests/cases/handle_svelte_files.rs
📚 Learning: 2025-10-02T12:55:57.554Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:55:57.554Z
Learning: Applies to .changeset/**/*.md : Changeset descriptions must end every sentence with a full stop (.)
Applied to files:
.changeset/wise-forks-hide.md
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Add the AsFormat, IntoFormat, and FormattedIterExt plumbing traits and impls to lib.rs as provided
Applied to files:
crates/biome_html_formatter/src/generated.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/language.rs : Create `HtmlTestFormatLanguage` and implement the `TestFormatLanguage` trait
Applied to files:
crates/biome_service/src/file_handlers/vue.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Define `pub(crate) type HtmlFormatter<'buf> = Formatter<'buf, HtmlFormatContext>;`
Applied to files:
crates/biome_service/src/file_handlers/vue.rs
crates/biome_configuration/src/html.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/context.rs : Define HtmlFormatContext with fields `comments: Rc<HtmlComments>` and `source_map: Option<TransformSourceMap>`, provide `new` and `with_source_map`, and implement FormatContext and CstFormatContext
Applied to files:
crates/biome_service/src/file_handlers/vue.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/comments.rs : Define HtmlCommentStyle and implement CommentStyle; create a public type alias `pub type HtmlComments = Comments<HtmlLanguage>;` in comments.rs
Applied to files:
crates/biome_service/src/file_handlers/vue.rs
📚 Learning: 2025-10-02T13:00:18.243Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T13:00:18.243Z
Learning: Applies to crates/biome_service/src/workspace.rs : `Workspace` trait implementation entry point is located at src/workspace.rs
Applied to files:
crates/biome_service/src/file_handlers/mod.rs
🧬 Code graph analysis (27)
crates/biome_service/src/diagnostics.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
DocumentFileSource
(9413-9421)crates/biome_service/src/file_handlers/mod.rs (1)
from_path
(283-285)
crates/biome_cli/src/execute/std_in.rs (4)
crates/biome_service/src/file_handlers/svelte.rs (1)
output
(43-54)crates/biome_service/src/file_handlers/vue.rs (1)
output
(43-54)crates/biome_service/src/workspace.rs (1)
file_features
(1417-1420)crates/biome_service/src/workspace/server.rs (1)
file_features
(1095-1117)
crates/biome_cli/src/execute/process_file/search.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
DocumentFileSource
(9413-9421)crates/biome_service/src/file_handlers/mod.rs (1)
from_path
(283-285)
crates/biome_lsp/src/handlers/analysis.rs (3)
crates/biome_service/src/file_handlers/svelte.rs (2)
output
(43-54)input
(34-39)crates/biome_service/src/file_handlers/vue.rs (2)
output
(43-54)input
(34-39)crates/biome_service/src/workspace/server.rs (1)
file_features
(1095-1117)
crates/biome_cli/tests/cases/handle_vue_files.rs (4)
crates/biome_cli/tests/snap_test.rs (1)
assert_cli_snapshot
(407-409)crates/biome_cli/tests/cases/handle_astro_files.rs (1)
full_support
(191-236)crates/biome_cli/tests/cases/handle_svelte_files.rs (2)
full_support
(217-262)full_support_ts
(265-315)crates/biome_cli/tests/main.rs (1)
run_cli
(332-347)
xtask/rules_check/src/lib.rs (6)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
DocumentFileSource
(9413-9421)crates/biome_service/src/file_handlers/svelte.rs (1)
parse
(123-141)crates/biome_service/src/file_handlers/vue.rs (1)
parse
(123-141)crates/biome_service/src/file_handlers/html.rs (1)
parse
(369-383)crates/biome_service/src/file_handlers/astro.rs (1)
parse
(109-130)crates/biome_html_parser/src/lib.rs (1)
parse_html
(37-40)
crates/biome_service/src/file_handlers/svelte.rs (1)
crates/biome_ruledoc_utils/src/codeblock.rs (1)
document_file_source
(96-98)
crates/biome_lsp/src/utils.rs (2)
crates/biome_line_index/src/line_index.rs (1)
offset
(91-95)crates/biome_lsp_converters/src/from_proto.rs (1)
offset
(8-30)
crates/biome_html_formatter/src/astro/auxiliary/embedded_content.rs (4)
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs (1)
fmt_fields
(8-24)crates/biome_service/src/file_handlers/html.rs (3)
node
(686-686)node
(694-694)node
(701-701)packages/@biomejs/js-api/src/common.ts (1)
FormatResult
(30-39)crates/biome_html_formatter/src/verbatim.rs (1)
format_html_verbatim_node
(28-36)
crates/biome_cli/src/execute/process_file/check.rs (3)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
FeaturesSupported
(21-21)crates/biome_cli/src/execute/process_file/lint_and_assist.rs (1)
analyze_with_guard
(49-185)crates/biome_cli/src/execute/process_file/format.rs (1)
format_with_guard
(37-136)
crates/biome_html_syntax/src/element_ext.rs (2)
crates/biome_html_syntax/src/lib.rs (1)
inner_string_text
(119-128)crates/biome_html_syntax/src/generated/nodes.rs (5)
value_token
(201-203)value_token
(331-333)value_token
(526-528)value_token
(766-768)value_token
(801-803)
crates/biome_lsp/src/handlers/formatting.rs (4)
crates/biome_js_syntax/src/file_source.rs (3)
astro
(203-205)svelte
(213-215)vue
(208-210)crates/biome_service/src/workspace/server.rs (1)
file_features
(1095-1117)crates/biome_service/src/file_handlers/svelte.rs (2)
output
(43-54)input
(34-39)crates/biome_service/src/file_handlers/vue.rs (2)
output
(43-54)input
(34-39)
crates/biome_html_formatter/src/generated.rs (2)
crates/biome_html_syntax/src/generated/nodes.rs (16)
fmt
(1030-1046)fmt
(1080-1101)fmt
(1135-1152)fmt
(1186-1200)fmt
(1234-1250)fmt
(1284-1308)fmt
(1342-1367)fmt
(1401-1417)fmt
(1451-1492)fmt
(1526-1547)fmt
(1581-1602)fmt
(1636-1652)fmt
(1686-1708)fmt
(1742-1768)fmt
(1802-1828)fmt
(1862-1883)crates/biome_html_formatter/src/lib.rs (10)
format
(49-49)format
(62-64)format
(79-84)format
(99-101)format
(295-297)new
(144-146)into_format
(110-110)into_format
(119-121)into_format
(133-135)into_format
(303-305)
crates/biome_cli/tests/cases/indent_script_and_style.rs (1)
crates/biome_cli/tests/snap_test.rs (1)
assert_cli_snapshot
(407-409)
crates/biome_service/src/settings.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
HtmlConfiguration
(252-270)FeatureKind
(11-17)
crates/biome_lsp/src/session.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (4)
OpenProjectParams
(9329-9338)OpenProjectResult
(9339-9344)PullDiagnosticsParams
(9601-9615)SupportsFeatureParams
(3-7)
crates/biome_service/src/file_handlers/vue.rs (1)
crates/biome_ruledoc_utils/src/codeblock.rs (1)
document_file_source
(96-98)
crates/biome_service/src/workspace/server.rs (2)
crates/biome_service/src/workspace.rs (1)
index
(590-599)crates/biome_service/src/file_handlers/mod.rs (2)
from_path
(283-285)can_contain_embeds
(400-412)
crates/biome_cli/src/execute/process_file.rs (3)
crates/biome_service/src/workspace.rs (1)
file_features
(1417-1420)crates/biome_cli/src/execute/process_file/format.rs (1)
format
(17-34)crates/biome_cli/src/execute/process_file/check.rs (1)
check_file
(11-104)
crates/biome_cli/src/execute/process_file/lint_and_assist.rs (3)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
FeaturesSupported
(21-21)crates/biome_service/src/file_handlers/svelte.rs (3)
output
(43-54)input
(34-39)start
(57-59)crates/biome_service/src/file_handlers/vue.rs (3)
output
(43-54)input
(34-39)start
(57-59)
crates/biome_configuration/src/html.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
Bool
(343-343)HtmlConfiguration
(252-270)
crates/biome_cli/tests/cases/handle_astro_files.rs (3)
crates/biome_cli/tests/cases/handle_svelte_files.rs (1)
full_support
(217-262)crates/biome_cli/tests/cases/handle_vue_files.rs (1)
full_support
(471-516)crates/biome_cli/tests/main.rs (1)
run_cli
(332-347)
crates/biome_html_formatter/src/astro/auxiliary/frontmatter_element.rs (3)
crates/biome_html_syntax/src/generated/nodes.rs (2)
l_fence_token
(78-80)content
(81-83)crates/biome_html_formatter/src/generated.rs (16)
format
(28-33)format
(66-71)format
(104-109)format
(142-144)format
(174-179)format
(212-217)format
(250-255)format
(288-293)format
(326-331)format
(364-370)format
(404-409)format
(442-447)format
(480-485)format
(512-517)format
(550-555)format
(588-594)crates/biome_formatter/src/builders.rs (1)
hard_line_break
(99-101)
crates/biome_service/src/file_handlers/mod.rs (4)
crates/biome_js_syntax/src/file_source.rs (5)
astro
(203-205)svelte
(213-215)vue
(208-210)try_from_well_known
(309-325)try_from_extension
(328-349)crates/biome_html_syntax/src/file_source.rs (6)
astro
(85-89)svelte
(96-100)vue
(91-95)html
(43-47)try_from_well_known
(103-109)try_from_extension
(112-121)crates/biome_service/src/file_handlers/svelte.rs (1)
file_source
(67-80)crates/biome_service/src/file_handlers/vue.rs (1)
file_source
(67-80)
crates/biome_service/src/file_handlers/html.rs (4)
crates/biome_js_parser/src/parse.rs (5)
parse_js_with_offset_and_cache
(396-409)parse
(187-192)parse
(233-234)parse
(261-264)cast
(37-43)crates/biome_rowan/src/ast/mod.rs (1)
cast_ref
(142-151)crates/biome_service/src/workspace/document.rs (4)
parse
(88-94)parse
(176-176)parse
(181-188)new
(158-172)crates/biome_html_syntax/src/element_ext.rs (1)
value_token
(277-282)
crates/biome_cli/tests/cases/handle_svelte_files.rs (4)
crates/biome_cli/tests/cases/handle_astro_files.rs (1)
full_support
(191-236)crates/biome_cli/tests/cases/handle_vue_files.rs (2)
full_support
(471-516)full_support_ts
(519-569)crates/biome_cli/tests/main.rs (1)
run_cli
(332-347)crates/biome_cli/tests/snap_test.rs (1)
assert_cli_snapshot
(407-409)
crates/biome_cli/src/execute/process_file/format.rs (5)
crates/biome_js_syntax/src/file_source.rs (3)
astro
(203-205)svelte
(213-215)vue
(208-210)packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
FeaturesSupported
(21-21)crates/biome_lsp/src/handlers/formatting.rs (1)
format
(21-104)crates/biome_service/src/file_handlers/svelte.rs (3)
format
(144-166)output
(43-54)input
(34-39)crates/biome_service/src/file_handlers/vue.rs (3)
format
(144-166)output
(43-54)input
(34-39)
⏰ 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). (7)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Check Dependencies
- GitHub Check: Documentation
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_analyze)
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_formatter_test/src/spec.rs (1)
306-309
: Duplicate snapshot index likely overwrites outputBoth outputs use with_index(1). Make the second output index 2 to keep both in the snapshot.
- .with_output_and_options( - SnapshotOutput::new(&output_code).with_index(1), + .with_output_and_options( + SnapshotOutput::new(&output_code).with_index(2), format_language.options(), )
♻️ Duplicate comments (1)
crates/biome_service/src/file_handlers/mod.rs (1)
676-676
: Duplicate:action_offset
field addition flagged previously.This change was flagged in a previous review, noting that all
CodeActionsParams
instantiation sites must now includeaction_offset: Option<TextSize>
.
🧹 Nitpick comments (4)
crates/biome_test_utils/src/lib.rs (1)
200-200
: Should JS-like discovery honour the experimental HTML flag?from_well_known(..., false) keeps HTML-ish files out of the JS-like set. If that’s intentional for test graphs, great; if not, consider plumbing a boolean into get_js_like_paths_in_dir so callers can opt in.
Would you like this walker to include .astro/.svelte/.vue when the experiment is enabled, or keep it JS-only by design?
crates/biome_service/src/workspace.rs (1)
933-940
: fix_all formatting flag: intentional change?format_node(..., false) differs from format() which passes true. If false disables embedded formatting, confirm this is the desired post-fix behaviour; otherwise align with format().
crates/biome_service/src/file_handlers/html.rs (2)
441-468
: Astro frontmatter parsing: confirm TS-by-default and unify content range
- Using JsFileSource::ts().with_embedding_kind(EmbeddingKind::Astro) is sensible (EmbeddingKind relaxes top-level return), but please confirm Astro frontmatter is always parsed as TS in Biome. If plain JS is expected, TS still parses, but it may affect semantics (e.g. shebangs/types).
- content_range uses text_trimmed_range() here, while other embeds use text_range(). Consider aligning for consistency (or switch the others), to avoid off-by-one/trivia surprises downstream.
- content.text_trimmed_range(), + content.text_range(),
546-550
: Skip unsupported style languages beyond SASSYou skip SASS; consider also skipping other unsupported preprocessor langs (e.g. Less) to avoid bogus parses until support lands.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
crates/biome_formatter_test/src/spec.rs
(1 hunks)crates/biome_html_syntax/src/element_ext.rs
(4 hunks)crates/biome_ruledoc_utils/src/codeblock.rs
(2 hunks)crates/biome_service/src/file_handlers/html.rs
(11 hunks)crates/biome_service/src/file_handlers/mod.rs
(12 hunks)crates/biome_service/src/file_handlers/svelte.rs
(1 hunks)crates/biome_service/src/file_handlers/vue.rs
(1 hunks)crates/biome_service/src/workspace.rs
(9 hunks)crates/biome_service/src/workspace/server.tests.rs
(4 hunks)crates/biome_test_utils/src/lib.rs
(3 hunks)xtask/rules_check/src/lib.rs
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- xtask/rules_check/src/lib.rs
- crates/biome_service/src/file_handlers/svelte.rs
- crates/biome_service/src/file_handlers/vue.rs
- crates/biome_html_syntax/src/element_ext.rs
🧰 Additional context used
📓 Path-based instructions (4)
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_formatter_test/src/spec.rs
crates/biome_service/src/workspace/server.tests.rs
crates/biome_test_utils/src/lib.rs
crates/biome_service/src/workspace.rs
crates/biome_ruledoc_utils/src/codeblock.rs
crates/biome_service/src/file_handlers/mod.rs
crates/biome_service/src/file_handlers/html.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Before committing, format Rust and TOML files (e.g., via
just f
/just format
)
Files:
crates/biome_formatter_test/src/spec.rs
crates/biome_service/src/workspace/server.tests.rs
crates/biome_test_utils/src/lib.rs
crates/biome_service/src/workspace.rs
crates/biome_ruledoc_utils/src/codeblock.rs
crates/biome_service/src/file_handlers/mod.rs
crates/biome_service/src/file_handlers/html.rs
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Document rules, assists, and options via inline rustdoc in Rust source
Files:
crates/biome_formatter_test/src/spec.rs
crates/biome_service/src/workspace/server.tests.rs
crates/biome_test_utils/src/lib.rs
crates/biome_service/src/workspace.rs
crates/biome_ruledoc_utils/src/codeblock.rs
crates/biome_service/src/file_handlers/mod.rs
crates/biome_service/src/file_handlers/html.rs
crates/biome_service/src/workspace.rs
📄 CodeRabbit inference engine (crates/biome_service/CONTRIBUTING.md)
Workspace
trait implementation entry point is located at src/workspace.rs
Files:
crates/biome_service/src/workspace.rs
🧠 Learnings (6)
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/language.rs : Create `HtmlTestFormatLanguage` and implement the `TestFormatLanguage` trait
Applied to files:
crates/biome_formatter_test/src/spec.rs
📚 Learning: 2025-10-02T13:00:18.243Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T13:00:18.243Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Watcher workspace-method tests reside in src/workspace/watcher.tests.rs
Applied to files:
crates/biome_service/src/workspace/server.tests.rs
📚 Learning: 2025-10-02T13:00:18.243Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T13:00:18.243Z
Learning: Applies to crates/biome_service/src/workspace.rs : `Workspace` trait implementation entry point is located at src/workspace.rs
Applied to files:
crates/biome_service/src/file_handlers/mod.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Expose a documented public function `format_node(options: HtmlFormatOptions, root: &HtmlSyntaxNode) -> FormatResult<Formatted<HtmlFormatContext>>` that calls `biome_formatter::format_node(root, HtmlFormatLanguage::new(options))`
Applied to files:
crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Implement `FormatLanguage` for `HtmlFormatLanguage` with associated types: `SyntaxLanguage = HtmlLanguage`, `Context = HtmlFormatContext`, `FormatRule = FormatHtmlSyntaxNode`
Applied to files:
crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-02T12:58:00.914Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:00.914Z
Learning: Applies to crates/biome_js_formatter/src/**/*.rs : Import and implement the FormatNode trait for your node types
Applied to files:
crates/biome_service/src/file_handlers/html.rs
🧬 Code graph analysis (6)
crates/biome_formatter_test/src/spec.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
DocumentFileSource
(9413-9421)crates/biome_formatter_test/src/test_prettier_snapshot.rs (1)
input_file
(56-58)
crates/biome_test_utils/src/lib.rs (2)
crates/biome_service/src/file_handlers/mod.rs (2)
from_path
(283-285)from_well_known
(164-166)crates/biome_ruledoc_utils/src/codeblock.rs (1)
document_file_source
(96-98)
crates/biome_service/src/workspace.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (3)
SupportKind
(22-27)FeatureKind
(11-17)TextSize
(9289-9289)
crates/biome_ruledoc_utils/src/codeblock.rs (1)
crates/biome_service/src/file_handlers/mod.rs (1)
from_extension
(207-209)
crates/biome_service/src/file_handlers/mod.rs (4)
crates/biome_js_syntax/src/file_source.rs (5)
astro
(203-205)svelte
(213-215)vue
(208-210)try_from_well_known
(309-325)try_from_extension
(328-349)crates/biome_html_syntax/src/file_source.rs (6)
astro
(85-89)svelte
(96-100)vue
(91-95)html
(43-47)try_from_well_known
(103-109)try_from_extension
(112-121)crates/biome_service/src/file_handlers/svelte.rs (1)
file_source
(67-80)crates/biome_service/src/file_handlers/vue.rs (1)
file_source
(67-80)
crates/biome_service/src/file_handlers/html.rs (5)
crates/biome_js_parser/src/parse.rs (5)
parse_js_with_offset_and_cache
(396-409)parse
(187-192)parse
(233-234)parse
(261-264)cast
(37-43)packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
EmbeddingKind
(9449-9449)JsFileSource
(9422-9431)crates/biome_rowan/src/ast/mod.rs (1)
cast_ref
(142-151)crates/biome_js_syntax/src/file_source.rs (2)
ts
(173-180)js_module
(158-160)crates/biome_html_syntax/src/element_ext.rs (1)
value_token
(295-300)
⏰ 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). (11)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Check Dependencies
- GitHub Check: Documentation
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: autofix
🔇 Additional comments (17)
crates/biome_service/src/workspace/server.tests.rs (1)
273-273
: LGTM. No tests invokeget_file_source(..., true)
—please confirm or add HTML-enabled scenarios.crates/biome_test_utils/src/lib.rs (2)
89-93
: Good propagation of the experimental flagPassing settings.experimental_full_html_support_enabled() into DocumentFileSource::from_path is the right thread-through. No further nits.
136-140
: Formatting path wiring looks rightSame here: options resolution now gets the correct file source with the experimental flag. LGTM.
crates/biome_formatter_test/src/spec.rs (1)
283-289
: Correct file source constructionUsing settings.experimental_full_html_support_enabled() here ensures the format language matches the test config. Looks good.
crates/biome_service/src/workspace.rs (3)
222-227
: Feature toggle wired correctlyHtmlFullSupport is marked Supported when the experimental setting is on. Looks sound.
990-991
: New CodeAction.offset: ensure client consumptionThe
offset
field is already included inpackages/@biomejs/backend-jsonrpc/src/workspace.ts
on theCodeAction
interface; update your CLI/LSP clients to consume and forward this optional property to avoid dropped offsets.
551-556
: Lockstep confirmed: TS FeatureKind updated
"htmlFullSupport"
present in TS union (packages/@biomejs/backend-jsonrpc/src/workspace.ts:17).crates/biome_service/src/file_handlers/html.rs (2)
480-491
: Nice: embed kind for Svelte/VueSetting EmbeddingKind::{Svelte,Vue} per outer file source is the right move for correct parsing semantics. LGTM.
964-980
: Safer snippet updates with AnyEmbeddedContentSwitching to AnyEmbeddedContent and handling Option tokens avoids panics and covers Astro. Good improvement.
crates/biome_service/src/file_handlers/mod.rs (8)
7-11
: LGTM: Public handler exposure.Making these handlers public aligns with the experimental full HTML support feature.
58-68
: Module visibility correctly updated.Public module declarations enable the re-exported handlers to be accessible externally.
123-127
: Backward compatibility preserved.Defaulting
experimental_full_html_support
tofalse
in the trait implementation ensures existing code behaviour remains unchanged.
130-166
: File source priority correctly gated by feature flag.The conditional logic appropriately switches detection priority between HTML and JS based on
experimental_full_html_support
, ensuring.vue
,.astro
, and.svelte
files are classified as HTML-first when the flag is enabled.
168-209
: Extension detection logic mirrors path-based detection.The conditional priority switch for extension-based detection correctly matches the behaviour in
try_from_well_known
.
400-402
: Feature flag correctly propagated.The
experimental_full_html_support
parameter is properly threaded through tofrom_path
.
729-729
: Debug trait appropriately added.Adding
Debug
toFormatEmbedNode
improves diagnostics without breaking changes.
815-820
: Temporary routing logic appropriately marked.The TODO comment correctly signals that this embedding kind dispatch is transitional and will be removed once the experimental handlers are replaced by the HTML-first approach.
pub fn document_file_source(&self) -> DocumentFileSource { | ||
DocumentFileSource::from_extension(&self.tag) | ||
DocumentFileSource::from_extension(&self.tag, false) | ||
} |
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
Confirm language-tag recognition without the experiment
Using DocumentFileSource::from_extension(tag, false) means code blocks won’t opt into experimental HTML support. Ensure astro/svelte/vue tags still resolve (i.e. aren’t Unknown) in ruledoc examples.
If they don’t, consider either:
- Passing a feature flag through this path, or
- Extending try_from_extension to recognise these tags irrespective of the experiment.
You can check current mappings with:
Also applies to: 141-143
🏁 Script executed:
#!/bin/bash
# Inspect extension->DocumentFileSource mapping
rg -nP 'try_from_extension|from_extension\(' -C3 crates/biome_service/src/file_handlers
Length of output: 4794
🏁 Script executed:
#!/bin/bash
# Inspect DocumentFileSource mappings in biome_ruledoc_utils
rg -nP 'enum DocumentFileSource' -C5 crates/biome_ruledoc_utils/src/codeblock.rs
rg -nP 'fn from_extension' -C10 crates/biome_ruledoc_utils/src/codeblock.rs
Length of output: 0
🏁 Script executed:
#!/bin/bash
# Locate and inspect DocumentFileSource in ruledoc_utils
fd codeblock.rs
rg -nP 'enum DocumentFileSource' -C5 $(fd codeblock.rs)
rg -nP 'fn from_extension' -C5 $(fd codeblock.rs)
Length of output: 43
🏁 Script executed:
#!/bin/bash
sed -n '1,300p' crates/biome_ruledoc_utils/src/codeblock.rs
Length of output: 5856
🏁 Script executed:
#!/bin/bash
# Locate and display HtmlFileSource implementation
fd html_file_source.rs crates/biome_service/src/file_handlers -t f | xargs sed -n '1,200p'
# Locate and display JsFileSource implementation
fd js_file_source.rs crates/biome_service/src/file_handlers -t f | xargs sed -n '1,200p'
Length of output: 0
🏁 Script executed:
#!/bin/bash
# Display top of mod.rs to inspect try_from_well_known
sed -n '1,200p' crates/biome_service/src/file_handlers/mod.rs
# Search for framework-specific file sources
rg -nP 'AstroFileSource|VueFileSource|SvelteFileSource|Astro|Vue|Svelte' -n crates/biome_service/src/file_handlers
Length of output: 12292
Enable framework tags in document_file_source
In crates/biome_ruledoc_utils/src/codeblock.rs
at document_file_source()
, calling
DocumentFileSource::from_extension(&self.tag, false)
will return Unknown
for astro
, vue
and svelte
. To fix:
- Pass
true
forexperimental_full_html_support
tofrom_extension
. - Or extend
DocumentFileSource::try_from_extension
to recognise these tags (mapping them toHtmlFileSource
with the correctEmbeddingKind
).
🤖 Prompt for AI Agents
In crates/biome_ruledoc_utils/src/codeblock.rs around lines 96–98,
document_file_source currently calls
DocumentFileSource::from_extension(&self.tag, false) which yields Unknown for
framework templates like astro, vue and svelte; update the call to pass true for
the experimental_full_html_support flag
(DocumentFileSource::from_extension(&self.tag, true)) so these tags are
recognised as HtmlFileSource with the proper EmbeddingKind, or alternatively
extend DocumentFileSource::try_from_extension to explicitly map "astro", "vue",
and "svelte" to HtmlFileSource with the correct EmbeddingKind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
crates/biome_html_syntax/src/element_ext.rs (1)
209-220
: Misleading variable name.Line 209: The variable is named
is_lang_typescript
but checks forsass
orscss
. Rename it tois_lang_sass
for clarity.Apply this diff:
- let is_lang_typescript = lang_attribute.is_some_and(|attribute| { + let is_lang_sass = lang_attribute.is_some_and(|attribute| { attribute .initializer() .and_then(|initializer| initializer.value().ok()) .and_then(|value| value.as_html_string().cloned()) .and_then(|value| value.value_token().ok()) .is_some_and(|token| { let text = inner_string_text(&token); text.eq_ignore_ascii_case("sass") || text.eq_ignore_ascii_case("scss") }) }); - is_style && is_lang_typescript + is_style && is_lang_sass
🧹 Nitpick comments (2)
crates/biome_service/src/workspace/server.tests.rs (1)
273-273
: Tests updated correctly for the API signature change
- All four
get_file_source()
calls now include thefalse
argument, matching theexperimental_full_html_support: bool
parameter.- That flag toggles experimental full HTML support (not JSX parsing), so forced JSX behaviour remains extension/config-driven.
- Consider adding a test case passing
true
(e.g. for an.html
file) to cover the new HTML support path.crates/biome_formatter_test/src/spec.rs (1)
283-289
: Consider documenting the experimental flag in the method comment.The rustdoc comment (lines 222-239) describes the two-output behaviour but doesn't mention that the second output respects the
experimental_full_html_support
flag fromoptions.json
. Consider adding a brief note about this to aid future maintainers.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
crates/biome_configuration/src/html.rs
(2 hunks)crates/biome_formatter_test/src/spec.rs
(1 hunks)crates/biome_html_syntax/src/element_ext.rs
(4 hunks)crates/biome_ruledoc_utils/src/codeblock.rs
(2 hunks)crates/biome_service/src/file_handlers/html.rs
(11 hunks)crates/biome_service/src/file_handlers/mod.rs
(12 hunks)crates/biome_service/src/file_handlers/svelte.rs
(1 hunks)crates/biome_service/src/file_handlers/vue.rs
(1 hunks)crates/biome_service/src/workspace.rs
(9 hunks)crates/biome_service/src/workspace/server.tests.rs
(4 hunks)crates/biome_test_utils/src/lib.rs
(3 hunks)xtask/rules_check/src/lib.rs
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- crates/biome_configuration/src/html.rs
- xtask/rules_check/src/lib.rs
🧰 Additional context used
📓 Path-based instructions (5)
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_service/src/file_handlers/vue.rs
crates/biome_service/src/workspace/server.tests.rs
crates/biome_test_utils/src/lib.rs
crates/biome_formatter_test/src/spec.rs
crates/biome_service/src/file_handlers/mod.rs
crates/biome_service/src/file_handlers/html.rs
crates/biome_service/src/workspace.rs
crates/biome_service/src/file_handlers/svelte.rs
crates/biome_ruledoc_utils/src/codeblock.rs
crates/biome_html_syntax/src/element_ext.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Before committing, format Rust and TOML files (e.g., via
just f
/just format
)
Files:
crates/biome_service/src/file_handlers/vue.rs
crates/biome_service/src/workspace/server.tests.rs
crates/biome_test_utils/src/lib.rs
crates/biome_formatter_test/src/spec.rs
crates/biome_service/src/file_handlers/mod.rs
crates/biome_service/src/file_handlers/html.rs
crates/biome_service/src/workspace.rs
crates/biome_service/src/file_handlers/svelte.rs
crates/biome_ruledoc_utils/src/codeblock.rs
crates/biome_html_syntax/src/element_ext.rs
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Document rules, assists, and options via inline rustdoc in Rust source
Files:
crates/biome_service/src/file_handlers/vue.rs
crates/biome_service/src/workspace/server.tests.rs
crates/biome_test_utils/src/lib.rs
crates/biome_formatter_test/src/spec.rs
crates/biome_service/src/file_handlers/mod.rs
crates/biome_service/src/file_handlers/html.rs
crates/biome_service/src/workspace.rs
crates/biome_service/src/file_handlers/svelte.rs
crates/biome_ruledoc_utils/src/codeblock.rs
crates/biome_html_syntax/src/element_ext.rs
crates/biome_service/src/workspace.rs
📄 CodeRabbit inference engine (crates/biome_service/CONTRIBUTING.md)
Workspace
trait implementation entry point is located at src/workspace.rs
Files:
crates/biome_service/src/workspace.rs
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**
📄 CodeRabbit inference engine (CLAUDE.md)
Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Files:
crates/biome_html_syntax/src/element_ext.rs
🧠 Learnings (9)
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Expose a documented public function `format_node(options: HtmlFormatOptions, root: &HtmlSyntaxNode) -> FormatResult<Formatted<HtmlFormatContext>>` that calls `biome_formatter::format_node(root, HtmlFormatLanguage::new(options))`
Applied to files:
crates/biome_service/src/file_handlers/vue.rs
crates/biome_service/src/file_handlers/html.rs
crates/biome_service/src/file_handlers/svelte.rs
📚 Learning: 2025-10-02T13:00:18.243Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T13:00:18.243Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Watcher workspace-method tests reside in src/workspace/watcher.tests.rs
Applied to files:
crates/biome_service/src/workspace/server.tests.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_test.rs : Provide a `run` function that builds a SpecSnapshot with HtmlFormatLanguage and HtmlTestFormatLanguage and calls `snapshot.test()`
Applied to files:
crates/biome_formatter_test/src/spec.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/language.rs : Create `HtmlTestFormatLanguage` and implement the `TestFormatLanguage` trait
Applied to files:
crates/biome_formatter_test/src/spec.rs
crates/biome_service/src/file_handlers/svelte.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_tests.rs : Configure test generation using `tests_macros::gen_tests! {"tests/specs/html/**/*.html", crate::spec_test::run, ""}` inside a formatter::html_module module
Applied to files:
crates/biome_formatter_test/src/spec.rs
📚 Learning: 2025-10-02T13:00:18.243Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T13:00:18.243Z
Learning: Applies to crates/biome_service/src/workspace.rs : `Workspace` trait implementation entry point is located at src/workspace.rs
Applied to files:
crates/biome_service/src/file_handlers/mod.rs
📚 Learning: 2025-10-02T12:58:46.845Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:46.845Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/src/lib.rs : Implement `FormatLanguage` for `HtmlFormatLanguage` with associated types: `SyntaxLanguage = HtmlLanguage`, `Context = HtmlFormatContext`, `FormatRule = FormatHtmlSyntaxNode`
Applied to files:
crates/biome_service/src/file_handlers/html.rs
crates/biome_service/src/file_handlers/svelte.rs
📚 Learning: 2025-10-02T12:58:00.914Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:00.914Z
Learning: Applies to crates/biome_js_formatter/src/**/*.rs : Import and implement the FormatNode trait for your node types
Applied to files:
crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-02T13:00:04.826Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T13:00:04.826Z
Learning: Applies to crates/biome_parser/**/language_kind.rs : Add the new language prefix (e.g., html_) to LANGUAGE_PREFIXES in language_kind.rs
Applied to files:
crates/biome_service/src/file_handlers/svelte.rs
🧬 Code graph analysis (9)
crates/biome_service/src/file_handlers/vue.rs (1)
crates/biome_ruledoc_utils/src/codeblock.rs (1)
document_file_source
(96-98)
crates/biome_test_utils/src/lib.rs (1)
crates/biome_service/src/file_handlers/mod.rs (2)
from_path
(283-285)from_well_known
(164-166)
crates/biome_formatter_test/src/spec.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
DocumentFileSource
(9413-9421)
crates/biome_service/src/file_handlers/mod.rs (4)
crates/biome_js_syntax/src/file_source.rs (5)
astro
(203-205)svelte
(213-215)vue
(208-210)try_from_well_known
(309-325)try_from_extension
(328-349)crates/biome_html_syntax/src/file_source.rs (6)
astro
(85-89)svelte
(96-100)vue
(91-95)html
(43-47)try_from_well_known
(103-109)try_from_extension
(112-121)crates/biome_service/src/file_handlers/svelte.rs (1)
file_source
(67-80)crates/biome_service/src/file_handlers/vue.rs (1)
file_source
(67-80)
crates/biome_service/src/file_handlers/html.rs (7)
crates/biome_js_parser/src/parse.rs (4)
parse_js_with_offset_and_cache
(396-409)parse
(187-192)parse
(233-234)parse
(261-264)crates/biome_service/src/file_handlers/svelte.rs (4)
settings
(150-150)settings
(151-151)file_source
(67-80)parse
(123-141)crates/biome_service/src/file_handlers/vue.rs (4)
settings
(150-150)settings
(151-151)file_source
(67-80)parse
(123-141)crates/biome_html_syntax/src/generated/nodes.rs (6)
content
(81-83)value_token
(201-203)value_token
(331-333)value_token
(526-528)value_token
(766-768)value_token
(801-803)crates/biome_js_syntax/src/file_source.rs (2)
ts
(173-180)js_module
(158-160)crates/biome_service/src/file_handlers/astro.rs (1)
parse
(109-130)crates/biome_html_syntax/src/element_ext.rs (1)
value_token
(295-300)
crates/biome_service/src/workspace.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (3)
SupportKind
(22-27)FeatureKind
(11-17)TextSize
(9289-9289)
crates/biome_service/src/file_handlers/svelte.rs (1)
crates/biome_ruledoc_utils/src/codeblock.rs (1)
document_file_source
(96-98)
crates/biome_ruledoc_utils/src/codeblock.rs (1)
crates/biome_service/src/file_handlers/mod.rs (1)
from_extension
(207-209)
crates/biome_html_syntax/src/element_ext.rs (2)
crates/biome_html_syntax/src/lib.rs (1)
inner_string_text
(119-128)crates/biome_html_syntax/src/generated/nodes.rs (6)
value
(165-167)value_token
(201-203)value_token
(331-333)value_token
(526-528)value_token
(766-768)value_token
(801-803)
⏰ 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). (11)
- GitHub Check: Documentation
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Check Dependencies
- GitHub Check: autofix
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_js_parser)
🔇 Additional comments (27)
crates/biome_ruledoc_utils/src/codeblock.rs (2)
141-142
: Consistent with line 97.Same hardcoded
false
used here for consistency. Both call sites now correctly match the updated API signature.
97-97
: Approve hardcodedfalse
for experimental_full_html_support
No references to experimental HTML support in this crate; disabling the feature by default is appropriate.crates/biome_test_utils/src/lib.rs (2)
89-92
: LGTM!The experimental full HTML support setting is properly retrieved and passed to
DocumentFileSource::from_path
.
136-139
: LGTM!Consistent with the previous change—correctly uses the experimental setting.
crates/biome_formatter_test/src/spec.rs (1)
283-289
: Drop consistency concern The first output deliberately uses the defaultFormatLanguage
built from initialFormatOptions
, while the second reflects anyoptions.json
overrides viato_format_language
; this divergence is intentional and correct.Likely an incorrect or invalid review comment.
crates/biome_service/src/file_handlers/svelte.rs (1)
151-151
: LGTM: Consistent with Vue handler changes.The removal of
to_htmlish()
conversion aligns with the full HTML support feature, usingdocument_file_source
directly for HTML language options.crates/biome_service/src/file_handlers/vue.rs (1)
151-151
: LGTM: Matches Svelte handler changes.Identical pattern to the Svelte file handler—consistently removes the
to_htmlish()
conversion for full HTML support.crates/biome_html_syntax/src/element_ext.rs (2)
188-203
: API simplification: Result wrapper removed.The signature change from
SyntaxResult<bool>
tobool
is a breaking change, but justified—the implementation never produces errors, only chains Options. Callers expectingResult
will need updating.
290-301
: LGTM: Clean union for embedded content types.The
AnyEmbeddedContent
union andvalue_token
method provide a unified interface for both HTML and Astro embedded content.crates/biome_service/src/workspace.rs (3)
134-140
: LGTM: HtmlFullSupport feature correctly integrated.The new
HtmlFullSupport
feature is consistently wired throughFeaturesSupported
, including settings checks and the new accessor method.Also applies to: 222-226, 277-280
551-552
: LGTM: Feature kind enum extended correctly.
NUM_FEATURE_KINDS
increased to 6, and all Display/index/mapping logic consistently handles the newHtmlFullSupport
variant.Also applies to: 555-555, 565-565, 583-583, 597-597, 626-626
990-990
: LGTM: Offset field added for action propagation.The new
offset
field inCodeAction
aligns with cross-module action offset handling introduced in the HTML full support feature.crates/biome_service/src/file_handlers/html.rs (7)
397-407
: LGTM: Astro embedded content path added.The early check for
AstroEmbeddedContent
before casting toHtmlElement
ensures Astro script blocks are processed via the dedicated helper.
441-468
: LGTM: Astro script parsing helper.The new
parse_astro_embedded_script
function correctly creates a TypeScript file source withEmbeddingKind::Astro
and uses offset-based parsing for the embedded content token.
479-490
: LGTM: Embedding kind handling for Svelte/Vue.The logic correctly assigns
EmbeddingKind::Svelte
orEmbeddingKind::Vue
when processing script tags in respective file types, whilst respecting TypeScript detection viais_typescript_lang
.
533-549
: LGTM: SASS exclusion prevents unsupported parsing.Skipping SASS/SCSS via
is_sass_lang
avoids attempting to parse unsupported style languages.
777-777
: LGTM: Action offset propagated correctly.The
action_offset
parameter is threaded through to theCodeAction
struct, enabling offset-aware code actions for HTML full support scenarios.Also applies to: 815-815
938-938
: LGTM: Embedding disabled during fix_all formatting.Passing
false
toformat_node
disables embedded content formatting, which is appropriate for the final fix_all output.
966-966
: LGTM: AnyEmbeddedContent traversal with optional token.Using
AnyEmbeddedContent::cast
unifies HTML and Astro embedded content handling, and the optionalvalue_token
correctly handles the nullable result.Also applies to: 976-976
crates/biome_service/src/file_handlers/mod.rs (8)
125-125
: Conditional detection order implemented correctly.The experimental flag correctly gates the precedence change: when enabled, HTML-ish files (
.vue
,.astro
,.svelte
) are detected as HTML rather than JS. Default behaviour (flag =false
) preserves backwards compatibility.Also applies to: 130-166
168-209
: Extension detection follows the same pattern.The conditional ordering is consistent with
try_from_well_known
. The comment on line 172 helpfully clarifies that order matters.
244-285
: Parameter threading is consistent.The
experimental_full_html_support
flag is correctly propagated through the call chain totry_from_well_known
andtry_from_extension
.
400-412
: Embed detection correctly gated.The method correctly uses the flag to detect HTML-ish files that can contain embedded nodes.
729-729
: Debug derive added for convenience.Adding
Debug
toFormatEmbedNode
improves debugging experience without any breaking changes.
373-381
: Formatting improved for readability.The vertical alignment of match arms improves consistency and readability.
815-815
: Transitional TODO noted.The comment indicates these handlers will be removed once the HTML-first approach is fully stable. This aligns with the PR's experimental nature.
7-11
: Refine search for removed FENCE constants usage
Found only internal references so far. Next, verify there are no external usages:rg -nP --type=rust '\b(ASTRO_FENCE|SVELTE_FENCE|VUE_FENCE)\b' --glob '!crates/biome_service/src/file_handlers/**/*.rs'
pub(crate) action_offset: Option<TextSize>, | ||
} |
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 all instantiation sites updated.
The action_offset
field was added to CodeActionsParams
. Ensure all instantiation sites across the codebase set this field.
Run the following script to verify all instantiations include the new field:
🏁 Script executed:
#!/bin/bash
# Description: Find CodeActionsParams instantiations and check for action_offset
# Search for struct instantiation patterns
rg -nP --type=rust -A5 'CodeActionsParams\s*\{' | rg -v 'action_offset'
Length of output: 3255
Add action_offset
to all CodeActionsParams instantiations
Each struct literal must now include the new action_offset
field (e.g. action_offset: None
). Update the following sites:
crates/biome_service/src/workspace/server.rs
(lines 1587, 1613)crates/biome_service/src/file_handlers/javascript.rs
(line 782)crates/biome_service/src/file_handlers/json.rs
(line 562)crates/biome_service/src/file_handlers/graphql.rs
(line 471)crates/biome_service/src/file_handlers/html.rs
(line 763)crates/biome_service/src/file_handlers/css.rs
(line 590)
🤖 Prompt for AI Agents
crates/biome_service/src/file_handlers/mod.rs around lines 676-677: the
CodeActionsParams struct gained a new field `action_offset: Option<TextSize>`
and all instantiations must be updated; for each listed site add `action_offset:
None` to the struct literal. Specifically modify the struct literals in
crates/biome_service/src/workspace/server.rs (lines 1587 and 1613),
crates/biome_service/src/file_handlers/javascript.rs (line 782),
crates/biome_service/src/file_handlers/json.rs (line 562),
crates/biome_service/src/file_handlers/graphql.rs (line 471),
crates/biome_service/src/file_handlers/html.rs (line 763), and
crates/biome_service/src/file_handlers/css.rs (line 590) by adding
`action_offset: None` (or appropriate Option<TextSize> value) to each
CodeActionsParams instance so the code compiles.
get_js_like_paths_in_dir(&path) | ||
} else { | ||
DocumentFileSource::from_well_known(&path) | ||
DocumentFileSource::from_well_known(&path, false) |
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.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
Verify the hardcoded false
value.
Whilst create_analyzer_options
and create_formatting_options
properly respect settings.experimental_full_html_support_enabled()
, this call hardcodes false
. When experimental full HTML support is enabled, HTML-ish files (.vue
, .svelte
, .astro
) may qualify as "JavaScript-like", but they'd be excluded from the module graph here.
Is this intentional? If not, consider plumbing the experimental setting through to module_graph_for_test_file
and get_js_like_paths_in_dir
to ensure test behaviour matches production.
Run the following script to check how from_well_known
and is_javascript_like
interact with the experimental flag:
🏁 Script executed:
#!/bin/bash
# Description: Examine DocumentFileSource implementation to understand the impact of the experimental flag
# Search for the from_well_known and try_from_well_known implementations
rg -nA 10 'pub fn (try_)?from_well_known' --type rust crates/biome_service/
# Search for is_javascript_like implementation
rg -nA 10 'pub fn is_javascript_like' --type rust crates/biome_service/
# Check how experimental_full_html_support affects file source detection
rg -nC 5 'experimental_full_html_support' --type rust crates/biome_service/src/file_handlers/
Length of output: 9036
🏁 Script executed:
#!/bin/bash
# Inspect the context around the hardcoded false in test utilities
rg -nC3 "DocumentFileSource::from_well_known" crates/biome_test_utils/src/lib.rs
Length of output: 319
🏁 Script executed:
#!/bin/bash
rg -nA5 "fn get_js_like_paths_in_dir" crates/biome_test_utils/src/lib.rs
Length of output: 267
Propagate experimental_full_html_support flag in test utils
Replace the hardcoded false
in DocumentFileSource::from_well_known
(e.g. in get_js_like_paths_in_dir
in crates/biome_test_utils/src/lib.rs
) with settings.experimental_full_html_support_enabled()
so HTML-ish files (.vue
, .svelte
, .astro
) aren’t excluded when the feature is enabled.
🤖 Prompt for AI Agents
In crates/biome_test_utils/src/lib.rs around line 200, the call
DocumentFileSource::from_well_known(&path, false) hardcodes false for
experimental_full_html_support; replace that literal with
settings.experimental_full_html_support_enabled() so HTML-ish files (.vue,
.svelte, .astro) are included when the feature is enabled, ensuring you pass the
settings flag into this function call (and update any surrounding code to have
access to settings if needed).
Ok, going to merge it. I think I addressed the majority of the feedback. I will update the docs later based on @dyc3 's feedback. If there are other major things that you see, please leave a comment and I'll address it |
Happy to see this merged, as I am waiting eagerly to switch to biome from eslint/prettier but I am using Svelte. This is clearly a step in the right direction, but I'm still a bit confused - is this in a useable state or not, given the Svelte particularities? |
@einarpersson it really depends on what you mean by "usable state", because I believe we mean different things |
Summary
Closes #6657
This PR removes the current partial support, and workaround for Vue, Svelte and Astro files, and instead uses the HTML parser to deliver experimental full support.
Full support means:
Test Plan
Updated the current snapshot tests
Docs
I added all the missing changesets that we skipped so far:
html.interpolation
biomejs/website#3204
Footnotes
The application of formatting and code fixes is consistent as per the configuration. This is a double-edged sword, because if you configure, for example, different quotes per language, the file will contain different quotes. We will create a discussion to address this ↩ ↩2