Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@PFiS1737
Copy link
Contributor

@PFiS1737 PFiS1737 commented Nov 8, 2025

Summary

No AI was used.

As I mentioned in discussion #8033, indentScriptAndStyle shouldn’t indent the frontmatter section in Astro files. I tried modifying the code accordingly, and it seems to work as expected.

However, I’ve only been working with Biome development for about three hours, so I’m not sure whether this change might have any side effects.

Test Plan

Added snap test.

Docs

@changeset-bot
Copy link

changeset-bot bot commented Nov 8, 2025

🦋 Changeset detected

Latest commit: 0fe1ef0

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

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

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added A-CLI Area: CLI A-Project Area: project A-Parser Area: parser L-JavaScript Language: JavaScript and super languages labels Nov 8, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 8, 2025

Walkthrough

Switches the EmbeddingKind::Astro variant to a struct form Astro { frontmatter: bool }; updates is_astro and adds is_astro_frontmatter. JsFileSource::astro() now creates Astro { frontmatter: false } and a new JsFileSource::astro_frontmatter() creates Astro { frontmatter: true }. HTML embedded-script formatting and capability dispatch now distinguish frontmatter vs regular Astro embeddings and propagate a should_indent flag so Astro frontmatter blocks are not indented even when indentScriptAndStyle is enabled. Adds a test dont_indent_frontmatter and a changeset entry.

Possibly related PRs

Suggested reviewers

  • dyc3

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 45.45% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: preventing indentation of Astro frontmatter via the indentScriptAndStyle option.
Description check ✅ Passed The description relates to the changeset, referencing discussion #8033 and explaining the fix prevents indentation of Astro frontmatter, with a test added.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 06786e4 and 0362fa9.

📒 Files selected for processing (1)
  • crates/biome_js_syntax/src/file_source.rs (3 hunks)
🧰 Additional context used
🧠 Learnings (6)
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import and use the `FormatNode` trait for AST nodes

Applied to files:

  • crates/biome_js_syntax/src/file_source.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/src/*_kinds_src.rs : Add src/<lang>_kinds_src.rs under xtask/codegen that returns a static KindSrc

Applied to files:

  • crates/biome_js_syntax/src/file_source.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When a token is mandatory and present in the AST, use the AST-provided token (e.g., `node.l_paren_token().format()`) instead of emitting a static token

Applied to files:

  • crates/biome_js_syntax/src/file_source.rs
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/src/{type_info,local_inference,resolver,flattening}.rs : Avoid recursive type structures and cross-module Arcs; represent links between types using TypeReference and TypeData::Reference.

Applied to files:

  • crates/biome_js_syntax/src/file_source.rs
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/src/type_info.rs : Add new TypeScript type support by extending the TypeData enum rather than introducing parallel structures.

Applied to files:

  • crates/biome_js_syntax/src/file_source.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/**/*.rs : After generation, remove usages of `format_verbatim_node` and implement real formatting with biome_formatter utilities

Applied to files:

  • crates/biome_js_syntax/src/file_source.rs
🧬 Code graph analysis (1)
crates/biome_js_syntax/src/file_source.rs (2)
crates/biome_html_syntax/src/generated/nodes.rs (1)
  • frontmatter (618-620)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
  • EmbeddingKind (9597-9597)
🔇 Additional comments (2)
crates/biome_js_syntax/src/file_source.rs (2)

134-139: Clean distinction between Astro contexts.

The logic correctly distinguishes regular Astro embedding from frontmatter, and the method names are clear and consistent with the codebase patterns.


209-214: Well-designed constructor API.

Both constructors are clear and follow the existing patterns in the codebase. The separation between astro() and astro_frontmatter() makes the API easy to use correctly.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
crates/biome_js_syntax/src/file_source.rs (1)

124-126: Consider adding a helper method for consistency.

The new AstroFrontmatter variant looks good, but other variants (Astro, Vue, Svelte) have corresponding is_*() helper methods (lines 134-142). For API consistency, consider adding:

 impl EmbeddingKind {
     pub const fn is_astro(&self) -> bool {
         matches!(self, Self::Astro)
     }
+    pub const fn is_astro_frontmatter(&self) -> bool {
+        matches!(self, Self::AstroFrontmatter)
+    }
     pub const fn is_vue(&self) -> bool {
         matches!(self, Self::Vue)
     }

This would allow direct checks like embedding_kind.is_astro_frontmatter() rather than pattern matching, though it's optional if the variant is only used in match expressions.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c09e45c and 3628313.

⛔ Files ignored due to path filters (1)
  • crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/dont_indent_frontmatter.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (5)
  • .changeset/vast-donuts-rescue.md (1 hunks)
  • crates/biome_cli/tests/cases/handle_astro_files.rs (1 hunks)
  • crates/biome_js_syntax/src/file_source.rs (1 hunks)
  • crates/biome_service/src/file_handlers/html.rs (3 hunks)
  • crates/biome_service/src/file_handlers/mod.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (22)
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import and use the `FormatNode` trait for AST nodes

Applied to files:

  • crates/biome_js_syntax/src/file_source.rs
  • crates/biome_service/src/file_handlers/mod.rs
  • crates/biome_service/src/file_handlers/html.rs
  • crates/biome_cli/tests/cases/handle_astro_files.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/src/*_kinds_src.rs : Add src/<lang>_kinds_src.rs under xtask/codegen that returns a static KindSrc

Applied to files:

  • crates/biome_js_syntax/src/file_source.rs
  • crates/biome_service/src/file_handlers/mod.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When a token is mandatory and present in the AST, use the AST-provided token (e.g., `node.l_paren_token().format()`) instead of emitting a static token

Applied to files:

  • crates/biome_js_syntax/src/file_source.rs
  • crates/biome_service/src/file_handlers/mod.rs
  • crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/src/type_info.rs : Add new TypeScript type support by extending the TypeData enum rather than introducing parallel structures.

Applied to files:

  • crates/biome_js_syntax/src/file_source.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/**/*.rs : After generation, remove usages of `format_verbatim_node` and implement real formatting with biome_formatter utilities

Applied to files:

  • crates/biome_service/src/file_handlers/mod.rs
  • crates/biome_service/src/file_handlers/html.rs
  • crates/biome_cli/tests/cases/handle_astro_files.rs
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/src/{type_info,local_inference,resolver,flattening}.rs : Avoid recursive type structures and cross-module Arcs; represent links between types using TypeReference and TypeData::Reference.

Applied to files:

  • crates/biome_service/src/file_handlers/mod.rs
  • crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Implement the `Format` trait for your node type and use `JsFormatter` with `write!`/`format_args!` to define formatting

Applied to files:

  • crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to fix code; if a mandatory token/node is missing, return `None` instead

Applied to files:

  • crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/cst.rs : Create FormatHtmlSyntaxNode in cst.rs implementing FormatRule<HtmlSyntaxNode> and AsFormat/IntoFormat for HtmlSyntaxNode using the provided plumbing

Applied to files:

  • crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For non-mandatory tokens, use the provided helper constructors (e.g., `token`, `space_token`, `dynamic_token`)

Applied to files:

  • crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/context.rs : Create HtmlFormatContext in context.rs with comments and source_map fields and implement FormatContext and CstFormatContext

Applied to files:

  • crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/Cargo.toml : Declare the dependency `biome_js_formatter = { version = "0.0.1", path = "../biome_js_formatter" }` for internal installation

Applied to files:

  • crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Expose a documented public function `format_node(options: HtmlFormatOptions, root: &HtmlSyntaxNode) -> FormatResult<Formatted<HtmlFormatContext>>` delegating to `biome_formatter::format_node`

Applied to files:

  • crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Implement FormatLanguage for HtmlFormatLanguage with associated types: SyntaxLanguage=HtmlLanguage, Context=HtmlFormatContext, FormatRule=FormatHtmlSyntaxNode

Applied to files:

  • crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in ../biome_lsp/src/server.tests.rs

Applied to files:

  • crates/biome_cli/tests/cases/handle_astro_files.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/spec_tests.rs : In tests/spec_tests.rs, generate tests with `tests_macros::gen_tests! {"tests/specs/html/**/*.html", crate::spec_test::run, ""}`

Applied to files:

  • crates/biome_cli/tests/cases/handle_astro_files.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/spec_test.rs : Implement a `run` function in tests/spec_test.rs that wires SpecSnapshot and includes!("language.rs") as shown

Applied to files:

  • crates/biome_cli/tests/cases/handle_astro_files.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/** : Create a tests directory containing a specs subfolder and the files spec_test.rs, spec_tests.rs, and language.rs

Applied to files:

  • crates/biome_cli/tests/cases/handle_astro_files.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/language.rs : Create tests/language.rs defining `HtmlTestFormatLanguage` and implement the TestFormatLanguage trait

Applied to files:

  • crates/biome_cli/tests/cases/handle_astro_files.rs
📚 Learning: 2025-10-15T09:25:05.698Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:25:05.698Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Place watcher tests related to workspace methods in src/workspace/watcher.tests.rs

Applied to files:

  • crates/biome_cli/tests/cases/handle_astro_files.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/**/Cargo.toml : Add the specified dev-dependencies under [dev-dependencies] for the test infrastructure

Applied to files:

  • crates/biome_cli/tests/cases/handle_astro_files.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/specs/html/**/*.html : Place HTML test cases under tests/specs/html as .html files discovered by the test macro

Applied to files:

  • crates/biome_cli/tests/cases/handle_astro_files.rs
🧬 Code graph analysis (3)
crates/biome_service/src/file_handlers/mod.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
  • EmbeddingKind (9597-9597)
crates/biome_service/src/file_handlers/html.rs (4)
crates/biome_service/src/file_handlers/vue.rs (1)
  • file_source (67-80)
crates/biome_service/src/file_handlers/svelte.rs (1)
  • file_source (67-80)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (3)
  • JsFileSource (9570-9579)
  • EmbeddingKind (9597-9597)
  • DocumentFileSource (9561-9569)
crates/biome_js_syntax/src/file_source.rs (1)
  • ts (176-183)
crates/biome_cli/tests/cases/handle_astro_files.rs (3)
crates/biome_service/src/file_handlers/mod.rs (12)
  • new (565-579)
  • new (796-810)
  • new (1055-1073)
  • new (1387-1401)
  • new (1556-1566)
  • from (88-90)
  • from (94-96)
  • from (100-102)
  • from (106-108)
  • from (112-114)
  • from (118-120)
  • from (124-126)
crates/biome_cli/tests/main.rs (1)
  • run_cli (332-347)
crates/biome_cli/tests/snap_test.rs (1)
  • assert_cli_snapshot (407-409)
🔇 Additional comments (6)
.changeset/vast-donuts-rescue.md (1)

1-5: LGTM – Clear changeset documentation.

The changeset accurately describes the user-facing behaviour change.

crates/biome_cli/tests/cases/handle_astro_files.rs (1)

671-717: Well-structured test for the new behaviour.

The test properly validates that Astro frontmatter remains unindented whilst regular <script> and <style> tags are indented when indentScriptAndStyle is enabled. Good coverage of the differential behaviour.

crates/biome_service/src/file_handlers/mod.rs (1)

817-817: Correct capability alignment for AstroFrontmatter.

Treating AstroFrontmatter the same as Astro for capabilities lookup ensures consistent file handling behaviour.

crates/biome_service/src/file_handlers/html.rs (3)

448-448: Correct use of AstroFrontmatter embedding kind.

The Astro frontmatter content is now properly tagged with EmbeddingKind::AstroFrontmatter, enabling differentiated formatting behaviour.


675-693: Clean implementation of conditional indentation.

The logic correctly skips indentation when either indent_script_and_style is false or the content is Astro frontmatter. The nested structure (hard line → indent → hard line → content → end indent) vs. (hard line → content) is appropriate for the two cases.


696-720: Proper frontmatter flag propagation.

The formatting correctly passes the frontmatter check for JavaScript embeddings (line 704) whilst JSON (line 713) and CSS (line 720) are marked as non-frontmatter. This ensures only Astro frontmatter sections bypass indentation.

@github-actions github-actions bot added the A-Tooling Area: internal tools label Nov 8, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
crates/biome_js_syntax/src/file_source.rs (1)

133-138: Consider the semantic clarity of is_astro().

The method is_astro() now returns true only for frontmatter: false, which might be unexpected. Callers might reasonably assume this method returns true for all Astro code, including frontmatter. Consider whether is_astro_script() or is_astro_non_frontmatter() would more clearly communicate the intent, or alternatively, have is_astro() match both variants using matches!(self, Self::Astro { .. }).

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3628313 and 06786e4.

⛔ Files ignored due to path filters (1)
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
📒 Files selected for processing (4)
  • crates/biome_js_syntax/src/file_source.rs (3 hunks)
  • crates/biome_service/src/file_handlers/html.rs (4 hunks)
  • crates/biome_service/src/file_handlers/mod.rs (1 hunks)
  • xtask/rules_check/src/lib.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_service/src/file_handlers/html.rs
🧰 Additional context used
🧠 Learnings (7)
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import and use the `FormatNode` trait for AST nodes

Applied to files:

  • crates/biome_service/src/file_handlers/mod.rs
  • crates/biome_js_syntax/src/file_source.rs
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/src/{type_info,local_inference,resolver,flattening}.rs : Avoid recursive type structures and cross-module Arcs; represent links between types using TypeReference and TypeData::Reference.

Applied to files:

  • crates/biome_service/src/file_handlers/mod.rs
  • crates/biome_js_syntax/src/file_source.rs
  • xtask/rules_check/src/lib.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/**/*.rs : After generation, remove usages of `format_verbatim_node` and implement real formatting with biome_formatter utilities

Applied to files:

  • crates/biome_service/src/file_handlers/mod.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/src/*_kinds_src.rs : Add src/<lang>_kinds_src.rs under xtask/codegen that returns a static KindSrc

Applied to files:

  • crates/biome_service/src/file_handlers/mod.rs
  • crates/biome_js_syntax/src/file_source.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When a token is mandatory and present in the AST, use the AST-provided token (e.g., `node.l_paren_token().format()`) instead of emitting a static token

Applied to files:

  • crates/biome_service/src/file_handlers/mod.rs
  • crates/biome_js_syntax/src/file_source.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to fix code; if a mandatory token/node is missing, return `None` instead

Applied to files:

  • crates/biome_service/src/file_handlers/mod.rs
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/src/type_info.rs : Add new TypeScript type support by extending the TypeData enum rather than introducing parallel structures.

Applied to files:

  • crates/biome_js_syntax/src/file_source.rs
🧬 Code graph analysis (3)
crates/biome_service/src/file_handlers/mod.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
  • EmbeddingKind (9597-9602)
crates/biome_js_syntax/src/file_source.rs (2)
crates/biome_html_syntax/src/generated/nodes.rs (1)
  • frontmatter (618-620)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
  • EmbeddingKind (9597-9602)
xtask/rules_check/src/lib.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
  • EmbeddingKind (9597-9602)
🔇 Additional comments (3)
xtask/rules_check/src/lib.rs (1)

288-288: Pattern match correctly updated for struct variant.

The wildcard pattern { .. } appropriately matches all Astro embedding variants, ensuring both frontmatter and non-frontmatter code is processed consistently.

crates/biome_service/src/file_handlers/mod.rs (1)

817-817: Capabilities routing correctly updated.

All Astro embedding variants are now properly routed to the Astro file handler, regardless of the frontmatter state.

crates/biome_js_syntax/src/file_source.rs (1)

208-213: Constructor implementation is sound.

The astro() and astro_frontmatter() constructors provide clear, distinct entry points for creating both Astro embedding variants.

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Great fix @PFiS1737 , users will appreciate it!

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 8, 2025

CodSpeed Performance Report

Merging #8037 will not alter performance

Comparing PFiS1737:fix-astro-frontmatter-indent (0fe1ef0) with main (2cef76a)1

Summary

✅ 53 untouched
⏩ 85 skipped2

Footnotes

  1. No successful run was found on main (c09e45c) during the generation of this report, so 2cef76a was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 85 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@dyc3 dyc3 merged commit 78011b1 into biomejs:main Nov 8, 2025
19 checks passed
@github-actions github-actions bot mentioned this pull request Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Parser Area: parser A-Project Area: project A-Tooling Area: internal tools L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants