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

Skip to content

Conversation

@dyc3
Copy link
Contributor

@dyc3 dyc3 commented Oct 29, 2025

Summary

This intentionally doesn't fix the @import things mentioned in the linked issue because the precise semantics are unclear.

fixes #7854

Test Plan

added new tests, and made sure the formatting aligns with prettier

Docs

@changeset-bot
Copy link

changeset-bot bot commented Oct 29, 2025

🦋 Changeset detected

Latest commit: 612da57

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

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

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

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

@github-actions github-actions bot added A-Parser Area: parser A-Formatter Area: formatter A-Tooling Area: internal tools L-CSS Language: CSS L-Grit Language: GritQL labels Oct 29, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 29, 2025

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 50828 50828 0
Passed 49624 49624 0
Failed 1162 1162 0
Panics 42 42 0
Coverage 97.63% 97.63% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 40 40 0
Passed 37 37 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.50% 92.50% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6320 6320 0
Passed 2106 2106 0
Failed 4214 4214 0
Panics 0 0 0
Coverage 33.32% 33.32% 0.00%

ts/babel

Test result main count This PR count Difference
Total 835 835 0
Passed 742 742 0
Failed 93 93 0
Panics 0 0 0
Coverage 88.86% 88.86% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 18813 18813 0
Passed 14065 14065 0
Failed 4747 4747 0
Panics 1 1 0
Coverage 74.76% 74.76% 0.00%

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 29, 2025

Walkthrough

Adds parsing and formatting support for Tailwind's new inline source form @source inline("..."). Changes include grammar updates (new AnyTwSource and TwSourceInline), lexer keyword registration for inline, parser logic and a new diagnostic helper expected_tw_source, adjustment of TwSourceAtRule to accept AnyTwSource, codegen/kind mappings, formatter implementations and wiring for AnyTwSource/TwSourceInline, and tests covering valid and error cases.

Possibly related PRs

Suggested reviewers

  • ematipico
  • siketyan

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.76% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The title "fix(parse/css): parse tailwind @source inline(...)" is concise, clear, and directly describes the primary change in the changeset. It uses standard commit conventions (fix prefix), specifies the affected component (parse/css), and clearly indicates what was fixed (parsing tailwind @source inline syntax). This title directly aligns with the objective of resolving issue #7854 regarding the CSS parser's inability to handle @source inline(...) directives when tailwindDirectives is enabled.
Linked Issues Check ✅ Passed The changes successfully address the requirements from issue #7854. The PR implements parser support for the @source inline(...) syntax through multiple complementary changes: the lexer now recognises "inline" as a keyword, the parser includes a new parse_source_inline function that handles the inline syntax with proper error diagnostics, the grammar definitions have been updated to include TwSourceInline and AnyTwSource types, and formatter rules have been added for both new node types. Test coverage has been added to verify both valid and invalid inline source cases. These changes collectively enable the CSS parser to correctly parse and format Tailwind's @source inline(...) directive.
Out of Scope Changes Check ✅ Passed All changes in the PR are scoped to implementing support for the @source inline(...) Tailwind syntax. The modifications include parser enhancements, formatter implementations, grammar definitions, keyword additions, and corresponding tests—all directly supporting the primary objective. No extraneous refactoring, unrelated features, or out-of-scope modifications were introduced. The Grit pattern mapping update is a standard maintenance change accompanying the new syntax node.
Description Check ✅ Passed The pull request description is related to the changeset and provides relevant context. It explicitly references issue #7854, mentions that new tests were added, and notes that formatting aligns with Prettier. While the description is relatively brief, it contains meaningful information connecting the PR to the underlying problem and testing approach, satisfying the lenient requirements for this check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dyc3/fix-tw-source-inline

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 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 7165d06 and d5d53b4.

⛔ Files ignored due to path filters (10)
  • crates/biome_css_factory/src/generated/node_factory.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_factory/src/generated/syntax_factory.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/source.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/simple.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-not.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_syntax/src/generated/kind.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_syntax/src/generated/macros.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_syntax/src/generated/nodes.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_syntax/src/generated/nodes_mut.rs is excluded by !**/generated/**, !**/generated/** and included by **
📒 Files selected for processing (16)
  • .changeset/ten-ears-stand.md (1 hunks)
  • crates/biome_css_formatter/src/generated.rs (2 hunks)
  • crates/biome_css_formatter/src/tailwind/any/mod.rs (1 hunks)
  • crates/biome_css_formatter/src/tailwind/any/source.rs (1 hunks)
  • crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs (1 hunks)
  • crates/biome_css_formatter/src/tailwind/auxiliary/source_inline.rs (1 hunks)
  • crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs (1 hunks)
  • crates/biome_css_formatter/tests/specs/css/tailwind/source-inline.css (1 hunks)
  • crates/biome_css_parser/src/lexer/mod.rs (1 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/tailwind.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/parse_error.rs (1 hunks)
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/source.css (1 hunks)
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-inline.css (1 hunks)
  • crates/biome_grit_patterns/src/grit_target_language/css_target_language/generated_mappings.rs (1 hunks)
  • xtask/codegen/css.ungram (1 hunks)
  • xtask/codegen/src/css_kinds_src.rs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{rs,toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Format Rust and TOML files before committing (e.g., via just f)

Files:

  • crates/biome_css_formatter/src/tailwind/any/mod.rs
  • crates/biome_css_formatter/src/tailwind/any/source.rs
  • crates/biome_css_parser/src/syntax/parse_error.rs
  • crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs
  • crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs
  • xtask/codegen/src/css_kinds_src.rs
  • crates/biome_css_parser/src/lexer/mod.rs
  • crates/biome_css_formatter/src/tailwind/auxiliary/source_inline.rs
  • crates/biome_grit_patterns/src/grit_target_language/css_target_language/generated_mappings.rs
  • crates/biome_css_parser/src/syntax/at_rule/tailwind.rs
  • crates/biome_css_formatter/src/generated.rs
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Document rules, assists, and their options with inline rustdoc in the Rust source

Files:

  • crates/biome_css_formatter/src/tailwind/any/mod.rs
  • crates/biome_css_formatter/src/tailwind/any/source.rs
  • crates/biome_css_parser/src/syntax/parse_error.rs
  • crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs
  • crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs
  • xtask/codegen/src/css_kinds_src.rs
  • crates/biome_css_parser/src/lexer/mod.rs
  • crates/biome_css_formatter/src/tailwind/auxiliary/source_inline.rs
  • crates/biome_grit_patterns/src/grit_target_language/css_target_language/generated_mappings.rs
  • crates/biome_css_parser/src/syntax/at_rule/tailwind.rs
  • crates/biome_css_formatter/src/generated.rs
.changeset/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

.changeset/*.md: In changeset files, only use #### or ##### headers
Changesets should describe user-facing changes; internal-only changes do not need changesets
Use past tense for what you did in the changeset description and present tense for current behavior
For bug fixes, start the changeset description with a link to the issue (e.g., Fixed #1234: ...)
When referencing a rule or assist in a changeset, include a link to the rule/assist page on the website
Include a code block in the changeset when applicable to illustrate the change
End every sentence in a changeset with a full stop (.)

Files:

  • .changeset/ten-ears-stand.md
🧠 Learnings (6)
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
PR: biomejs/biome#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_css_formatter/src/tailwind/any/source.rs
  • crates/biome_css_formatter/src/tailwind/auxiliary/source_inline.rs
  • crates/biome_css_formatter/src/generated.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
PR: biomejs/biome#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_css_formatter/src/tailwind/any/source.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
PR: biomejs/biome#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_css_formatter/src/tailwind/any/source.rs
  • crates/biome_css_formatter/src/tailwind/auxiliary/source_inline.rs
  • crates/biome_css_formatter/src/generated.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
PR: biomejs/biome#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_css_formatter/src/tailwind/any/source.rs
  • crates/biome_css_formatter/src/tailwind/auxiliary/source_inline.rs
  • crates/biome_css_formatter/src/generated.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
PR: biomejs/biome#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_css_formatter/src/tailwind/any/source.rs
  • crates/biome_css_formatter/src/tailwind/auxiliary/source_inline.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
PR: biomejs/biome#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_css_formatter/src/generated.rs
🧬 Code graph analysis (7)
crates/biome_css_formatter/src/tailwind/any/mod.rs (2)
crates/biome_css_parser/src/lexer/mod.rs (1)
  • source (107-109)
crates/biome_css_syntax/src/generated/nodes.rs (3)
  • source (558-560)
  • source (6749-6751)
  • source (7278-7280)
crates/biome_css_formatter/src/tailwind/any/source.rs (1)
crates/biome_css_formatter/src/generated.rs (16)
  • fmt (12-14)
  • fmt (46-52)
  • fmt (84-90)
  • fmt (124-130)
  • fmt (162-168)
  • fmt (200-206)
  • fmt (238-244)
  • fmt (276-282)
  • fmt (314-320)
  • fmt (350-352)
  • fmt (373-379)
  • fmt (411-417)
  • fmt (449-455)
  • fmt (481-487)
  • fmt (519-525)
  • fmt (559-565)
crates/biome_css_parser/src/syntax/parse_error.rs (1)
crates/biome_parser/src/diagnostic.rs (1)
  • expected_any (486-488)
crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs (2)
crates/biome_css_syntax/src/generated/nodes.rs (25)
  • source_token (7272-7274)
  • not_token (820-822)
  • not_token (1085-1087)
  • not_token (3165-3167)
  • not_token (6042-6044)
  • not_token (7275-7277)
  • source (558-560)
  • source (6749-6751)
  • source (7278-7280)
  • semicolon_token (347-349)
  • semicolon_token (1553-1555)
  • semicolon_token (1684-1686)
  • semicolon_token (2234-2236)
  • semicolon_token (2788-2790)
  • semicolon_token (3444-3446)
  • semicolon_token (6489-6491)
  • semicolon_token (6624-6626)
  • semicolon_token (6912-6914)
  • semicolon_token (6957-6959)
  • semicolon_token (7051-7053)
  • semicolon_token (7146-7148)
  • semicolon_token (7192-7194)
  • semicolon_token (7233-7235)
  • semicolon_token (7281-7283)
  • semicolon_token (7335-7337)
crates/biome_formatter/src/builders.rs (1)
  • space (606-608)
crates/biome_css_formatter/src/tailwind/auxiliary/source_inline.rs (2)
crates/biome_css_syntax/src/generated/nodes.rs (50)
  • inline_token (7323-7325)
  • l_paren_token (906-908)
  • l_paren_token (951-953)
  • l_paren_token (1041-1043)
  • l_paren_token (1175-1177)
  • l_paren_token (1640-1642)
  • l_paren_token (1980-1982)
  • l_paren_token (2280-2282)
  • l_paren_token (2330-2332)
  • l_paren_token (2580-2582)
  • l_paren_token (3041-3043)
  • l_paren_token (3121-3123)
  • l_paren_token (3839-3841)
  • l_paren_token (4018-4020)
  • l_paren_token (4068-4070)
  • l_paren_token (4118-4120)
  • l_paren_token (4168-4170)
  • content (7329-7331)
  • r_paren_token (912-914)
  • r_paren_token (957-959)
  • r_paren_token (1047-1049)
  • r_paren_token (1181-1183)
  • r_paren_token (1646-1648)
  • r_paren_token (1986-1988)
  • r_paren_token (2286-2288)
  • r_paren_token (2336-2338)
  • r_paren_token (2586-2588)
  • r_paren_token (3047-3049)
  • r_paren_token (3127-3129)
  • r_paren_token (3845-3847)
  • r_paren_token (4024-4026)
  • r_paren_token (4074-4076)
  • r_paren_token (4124-4126)
  • r_paren_token (4174-4176)
  • semicolon_token (347-349)
  • semicolon_token (1553-1555)
  • semicolon_token (1684-1686)
  • semicolon_token (2234-2236)
  • semicolon_token (2788-2790)
  • semicolon_token (3444-3446)
  • semicolon_token (6489-6491)
  • semicolon_token (6624-6626)
  • semicolon_token (6912-6914)
  • semicolon_token (6957-6959)
  • semicolon_token (7051-7053)
  • semicolon_token (7146-7148)
  • semicolon_token (7192-7194)
  • semicolon_token (7233-7235)
  • semicolon_token (7281-7283)
  • semicolon_token (7335-7337)
crates/biome_formatter/src/builders.rs (1)
  • soft_line_break (67-69)
crates/biome_css_parser/src/syntax/at_rule/tailwind.rs (1)
crates/biome_css_parser/src/syntax/parse_error.rs (2)
  • expected_string (50-52)
  • expected_tw_source (243-245)
crates/biome_css_formatter/src/generated.rs (1)
crates/biome_css_syntax/src/generated/nodes.rs (3)
  • source (558-560)
  • source (6749-6751)
  • source (7278-7280)
⏰ 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: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Parser conformance
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: Test Node.js API
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Check Dependencies
  • GitHub Check: autofix
🔇 Additional comments (17)
crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/source.css (1)

1-2: LGTM!

These error test cases appropriately validate the parser's handling of invalid @source directives.

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

943-943: LGTM!

The keyword mapping for "inline" follows the established pattern and is correctly positioned among the Tailwind CSS keywords.

crates/biome_grit_patterns/src/grit_target_language/css_target_language/generated_mappings.rs (1)

216-216: LGTM!

The generated mapping for TwSourceInline follows the established pattern correctly.

.changeset/ten-ears-stand.md (1)

1-5: LGTM!

The changeset follows the project guidelines: uses past tense, starts with the issue link, describes the user-facing change clearly, and ends with a full stop.

crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs (1)

5-5: LGTM!

The generated module declaration for source_inline is correctly formatted and positioned.

crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-inline.css (1)

1-2: LGTM!

Good test coverage for both the inline syntax and its negation with not.

crates/biome_css_formatter/tests/specs/css/tailwind/source-inline.css (1)

1-2: LGTM!

These test cases provide good coverage for the formatter, including a longer utility list that will help verify formatting behaviour with more complex content.

crates/biome_css_formatter/src/tailwind/any/mod.rs (1)

4-4: LGTM!

The generated module declaration for source is correctly formatted and positioned alphabetically.

crates/biome_css_formatter/src/tailwind/any/source.rs (1)

1-15: LGTM! Standard generated formatter pattern.

This follows the established pattern for formatting union types, correctly delegating to the respective node formatters for each variant.

crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs (1)

8-20: LGTM! Field rename correctly applied.

The update from path to source aligns with the grammar changes and maintains the original formatting behavior.

xtask/codegen/src/css_kinds_src.rs (2)

518-518: LGTM! Node type added correctly.

The TW_SOURCE_INLINE node is appropriately placed in the Tailwind nodes section.


132-132: Lexer properly handles the "inline" keyword.

The keyword is correctly mapped in the lexer at line 943 as b"inline" => INLINE_KW, confirming the codegen comment's requirement has been satisfied. The "inline" keyword is used for Tailwind CSS's @source inline(...) feature to ensure certain utility classes are always generated.

crates/biome_css_parser/src/syntax/at_rule/tailwind.rs (1)

233-239: Check ungram alignment for semicolon.

The parser handles inline(...) correctly, but the ungram at lines 1959-1964 shows TwSourceInline includes a trailing semicolon in its definition. However, here the semicolon is parsed at line 240 as part of the parent TwSourceAtRule. This mismatch suggests the ungram may need correction—the semicolon should belong to TwSourceAtRule, not TwSourceInline.

Could you verify the ungram definition? Compare:

  • ungram line 1964: TwSourceInline ends with ';'
  • ungram line 1953: TwSourceAtRule ends with ';'

One of these is likely redundant.

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

243-245: LGTM! Clear diagnostic message.

The error message helpfully shows both accepted formats: plain string literals and the new inline("...") syntax.

crates/biome_css_formatter/src/tailwind/auxiliary/source_inline.rs (1)

8-30: Formatter will need regeneration after ungram fix.

This formatter currently includes semicolon_token (lines 14, 26) because the ungram incorrectly places the semicolon in TwSourceInline. Once the ungram is corrected (removing the semicolon from TwSourceInline), run cargo codegen formatter to regenerate this file without the semicolon handling.

crates/biome_css_formatter/src/generated.rs (2)

9636-9660: Formatter implementation verified—all variants covered without fallbacks

The output confirms FormatAnyTwSource exhaustively handles both variants with no format_verbatim fallbacks, and AnyTwSource correctly maps to CssString | TwSourceInline as stated.


5825-5862: All wired up correctly—implementation and exports confirmed

The FormatTwSourceInline struct is present and properly exported through the module hierarchy (tailwind/mod.rsauxiliary/mod.rssource_inline.rs). The generated FormatRule impl points to the right path and follows the established pattern.

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 29, 2025

CodSpeed Performance Report

Merging #7921 will not alter performance

Comparing dyc3/fix-tw-source-inline (612da57) with main (bf4d8ec)1

Summary

✅ 29 untouched
⏩ 111 skipped2

Footnotes

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

  2. 111 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 force-pushed the dyc3/fix-tw-source-inline branch 2 times, most recently from 558eaaa to ca923cb Compare October 29, 2025 16:08
@dyc3 dyc3 force-pushed the dyc3/fix-tw-source-inline branch from ca923cb to 7b993cb Compare October 30, 2025 11:30
@dyc3 dyc3 requested review from a team October 30, 2025 11:35
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_css_parser/tests/css_test_suite/ok/tailwind/source-inline.css (1)

1-2: Test cases look good.

The two test cases cover the core inline source variants (with and without the not modifier), and they're well-placed in the tailwind test suite. If you'd like to expand coverage later, edge cases like empty arguments or multiple arguments could be useful—but this is solid for the current feature scope.

📜 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 ca923cb and 7b993cb.

⛔ Files ignored due to path filters (12)
  • crates/biome_css_factory/src/generated/node_factory.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_factory/src/generated/syntax_factory.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_formatter/tests/specs/css/tailwind/source-inline.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/source.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/simple.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-inline.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-not.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_syntax/src/generated/kind.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_syntax/src/generated/macros.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_syntax/src/generated/nodes.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_css_syntax/src/generated/nodes_mut.rs is excluded by !**/generated/**, !**/generated/** and included by **
📒 Files selected for processing (16)
  • .changeset/ten-ears-stand.md (1 hunks)
  • crates/biome_css_formatter/src/generated.rs (2 hunks)
  • crates/biome_css_formatter/src/tailwind/any/mod.rs (1 hunks)
  • crates/biome_css_formatter/src/tailwind/any/source.rs (1 hunks)
  • crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs (1 hunks)
  • crates/biome_css_formatter/src/tailwind/auxiliary/source_inline.rs (1 hunks)
  • crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs (1 hunks)
  • crates/biome_css_formatter/tests/specs/css/tailwind/source-inline.css (1 hunks)
  • crates/biome_css_parser/src/lexer/mod.rs (1 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/tailwind.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/parse_error.rs (1 hunks)
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/source.css (1 hunks)
  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-inline.css (1 hunks)
  • crates/biome_grit_patterns/src/grit_target_language/css_target_language/generated_mappings.rs (1 hunks)
  • xtask/codegen/css.ungram (1 hunks)
  • xtask/codegen/src/css_kinds_src.rs (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (9)
  • crates/biome_css_formatter/tests/specs/css/tailwind/source-inline.css
  • crates/biome_css_formatter/src/tailwind/auxiliary/source_inline.rs
  • crates/biome_css_parser/src/lexer/mod.rs
  • crates/biome_css_formatter/src/tailwind/any/mod.rs
  • crates/biome_css_parser/src/syntax/parse_error.rs
  • crates/biome_css_parser/src/syntax/at_rule/tailwind.rs
  • crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/source.css
  • crates/biome_grit_patterns/src/grit_target_language/css_target_language/generated_mappings.rs
  • .changeset/ten-ears-stand.md
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{rs,toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Format Rust and TOML files before committing (e.g., via just f)

Files:

  • xtask/codegen/src/css_kinds_src.rs
  • crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs
  • crates/biome_css_formatter/src/tailwind/any/source.rs
  • crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs
  • crates/biome_css_formatter/src/generated.rs
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Document rules, assists, and their options with inline rustdoc in the Rust source

Files:

  • xtask/codegen/src/css_kinds_src.rs
  • crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs
  • crates/biome_css_formatter/src/tailwind/any/source.rs
  • crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs
  • crates/biome_css_formatter/src/generated.rs
🧠 Learnings (28)
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/src/*_kinds_src.rs : Add src/<lang>_kinds_src.rs under xtask/codegen that returns a static KindSrc

Applied to files:

  • xtask/codegen/src/css_kinds_src.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/xtask/codegen/*.ungram : Unions of nodes must start with Any* (e.g., AnyHtmlAttribute)

Applied to files:

  • xtask/codegen/css.ungram
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/tests/quick_test.rs : Quick test lives in biome_js_analyze/tests/quick_test.rs; unignore #[ignore] and set rule filter and SOURCE for ad-hoc runs

Applied to files:

  • crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-inline.css
  • crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
PR: biomejs/biome#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_css_formatter/src/tailwind/statements/source_at_rule.rs
  • crates/biome_css_formatter/src/tailwind/any/source.rs
  • crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs
  • crates/biome_css_formatter/src/generated.rs
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : If a rule is inspired by an external source, populate sources in declare_lint_rule! with RuleSource::{Eslint,...} and same()/inspired()

Applied to files:

  • crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs
  • crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs
  • crates/biome_css_formatter/src/generated.rs
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : Set the language field in declare_lint_rule! to the most appropriate dialect (js/jsx/ts/tsx)

Applied to files:

  • crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : Rule documentation: first paragraph must be a single line summary

Applied to files:

  • crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs
  • crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs
  • crates/biome_css_formatter/src/generated.rs
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Place per-rule options types in biome_rule_options crate under lib/, one file per rule

Applied to files:

  • crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs
  • crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs
  • crates/biome_css_formatter/src/generated.rs
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/style/**/*.rs : Rules in style group must have severity: info or warn (prefer info if unsure)

Applied to files:

  • crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : In declare_lint_rule! macros, set version: "next"

Applied to files:

  • crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs
📚 Learning: 2025-10-26T15:28:00.951Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-10-26T15:28:00.951Z
Learning: Applies to **/*.rs : Document rules, assists, and their options with inline rustdoc in the Rust source

Applied to files:

  • crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs
  • crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs
  • crates/biome_css_formatter/src/generated.rs
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : Every code block in docs must declare a language

Applied to files:

  • crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
PR: biomejs/biome#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_css_formatter/src/tailwind/any/source.rs
  • crates/biome_css_formatter/src/generated.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
PR: biomejs/biome#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_css_formatter/src/tailwind/any/source.rs
  • crates/biome_css_formatter/src/generated.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
PR: biomejs/biome#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_css_formatter/src/tailwind/any/source.rs
  • crates/biome_css_formatter/src/generated.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
PR: biomejs/biome#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_css_formatter/src/tailwind/any/source.rs
  • crates/biome_css_formatter/src/generated.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
PR: biomejs/biome#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_css_formatter/src/tailwind/any/source.rs
  • crates/biome_css_formatter/src/generated.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Add the provided AsFormat, IntoFormat, and iterator plumbing code to lib.rs

Applied to files:

  • crates/biome_css_formatter/src/tailwind/any/source.rs
  • crates/biome_css_formatter/src/generated.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/lib.rs : Define the HtmlFormatter type alias: `type HtmlFormatter<'buf> = Formatter<'buf, HtmlFormatContext>;`

Applied to files:

  • crates/biome_css_formatter/src/tailwind/any/source.rs
  • crates/biome_css_formatter/src/generated.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
PR: biomejs/biome#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_css_formatter/src/tailwind/any/source.rs
  • crates/biome_css_formatter/src/generated.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
PR: biomejs/biome#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_css_formatter/src/tailwind/any/source.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
PR: biomejs/biome#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_css_formatter/src/tailwind/any/source.rs
📚 Learning: 2025-10-15T09:24:31.042Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:24:31.042Z
Learning: Applies to crates/biome_parser/crates/**/src/lexer/mod.rs : Create a lexer module at crates/<parser_crate>/src/lexer/mod.rs

Applied to files:

  • crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : Use options/full_options/use_options code block modifiers as specified to demonstrate configuration in docs; keep modifier order consistent

Applied to files:

  • crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs
📚 Learning: 2025-10-24T21:24:58.650Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.650Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/lint/nursery/**/*.rs : Place all new rules in the nursery group

Applied to files:

  • crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
PR: biomejs/biome#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_css_formatter/src/tailwind/auxiliary/mod.rs
📚 Learning: 2025-08-20T16:24:59.781Z
Learnt from: arendjr
PR: biomejs/biome#7266
File: crates/biome_js_type_info/src/type.rs:94-102
Timestamp: 2025-08-20T16:24:59.781Z
Learning: In crates/biome_js_type_info/src/type.rs, the flattened_union_variants() method returns TypeReference instances that already have the correct module IDs applied to them. These references should be used directly with resolver.resolve_reference() without applying additional module ID transformations, as variant references may originate from nested unions in different modules.

Applied to files:

  • crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs
📚 Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/comments.rs : Define HtmlCommentStyle implementing CommentStyle in comments.rs

Applied to files:

  • crates/biome_css_formatter/src/generated.rs
🧬 Code graph analysis (2)
crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs (1)
crates/biome_css_syntax/src/generated/nodes.rs (23)
  • not_token (820-822)
  • not_token (1085-1087)
  • not_token (3165-3167)
  • not_token (6042-6044)
  • not_token (7275-7277)
  • source (558-560)
  • source (6749-6751)
  • source (7278-7280)
  • semicolon_token (347-349)
  • semicolon_token (1553-1555)
  • semicolon_token (1684-1686)
  • semicolon_token (2234-2236)
  • semicolon_token (2788-2790)
  • semicolon_token (3444-3446)
  • semicolon_token (6489-6491)
  • semicolon_token (6624-6626)
  • semicolon_token (6912-6914)
  • semicolon_token (6957-6959)
  • semicolon_token (7051-7053)
  • semicolon_token (7146-7148)
  • semicolon_token (7192-7194)
  • semicolon_token (7233-7235)
  • semicolon_token (7281-7283)
crates/biome_css_formatter/src/generated.rs (1)
crates/biome_css_syntax/src/generated/nodes.rs (3)
  • source (558-560)
  • source (6749-6751)
  • source (7278-7280)
⏰ 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 Node.js API
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Parser conformance
  • GitHub Check: Check Dependencies
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_css_analyze)
🔇 Additional comments (10)
xtask/codegen/src/css_kinds_src.rs (2)

518-518: LGTM!

The new node follows existing conventions and is appropriately placed in the Tailwind 4.0 section.


132-132: The lexer has been correctly updated.

The "inline" keyword is properly registered at line 943 in consume_identifier: b"inline" => INLINE_KW,. The requirement to add it to the lexer has been fulfilled.

xtask/codegen/css.ungram (3)

1948-1954: LGTM!

The field rename from path to source and type change to AnyTwSource properly generalises the rule to support both string paths and inline content. The added comment provides a helpful example.


1955-1958: LGTM!

The union type correctly follows the Any* naming convention for unions and enables both existing string-based and new inline source forms.


1959-1964: LGTM!

The TwSourceInline definition correctly models the inline(...) syntax without a trailing semicolon, as the semicolon belongs to the containing TwSourceAtRule.

crates/biome_css_formatter/src/tailwind/auxiliary/mod.rs (1)

5-5: LGTM!

The module declaration follows the existing pattern and is consistent with sibling modules.

crates/biome_css_formatter/src/tailwind/statements/source_at_rule.rs (1)

8-20: LGTM!

The field rename from path to source correctly reflects the grammar change, and the formatting logic properly delegates to the new AnyTwSource type, which will handle both string and inline variants.

crates/biome_css_formatter/src/tailwind/any/source.rs (1)

1-15: LGTM!

The generated formatter correctly implements the standard pattern for union types, delegating formatting to the appropriate variant formatter.

crates/biome_css_formatter/src/generated.rs (2)

5825-5862: Good addition: TwSourceInline formatting is wired up

Plumbing looks spot‑on and consistent with the generator. Please double‑check that crate::tailwind::auxiliary::source_inline::FormatTwSourceInline is public, derives Default, and implements real formatting (no format_verbatim_node). Also worth a quick round‑trip test for quoting/spacing around inline(...) to match Prettier parity. Cheers.


9636-9660: AnyTwSource glue looks correct

AsFormat/IntoFormat target crate::tailwind::any::source::FormatAnyTwSource as expected. Please verify that FormatAnyTwSource handles all enum arms (including the new inline variant) and produces a sensible fallback for bogus nodes. If that’s green, ship it.

@dyc3
Copy link
Contributor Author

dyc3 commented Nov 2, 2025

The CI failure looks unrelated.

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.

Thank you!

@dyc3 dyc3 merged commit 547c2da into main Nov 3, 2025
18 checks passed
@dyc3 dyc3 deleted the dyc3/fix-tw-source-inline branch November 3, 2025 11:58
@github-actions github-actions bot mentioned this pull request Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Formatter Area: formatter A-Parser Area: parser A-Tooling Area: internal tools L-CSS Language: CSS L-Grit Language: GritQL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 CSS parser with tailwindDirectives does not parse @source inline();

3 participants