-
-
Notifications
You must be signed in to change notification settings - Fork 759
fix(parse/css): parse tailwind @source inline(...)
#7921
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: 612da57 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
WalkthroughAdds parsing and formatting support for Tailwind's new inline source form Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 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: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (10)
crates/biome_css_factory/src/generated/node_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_factory/src/generated/syntax_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/source.css.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/tailwind/simple.css.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-not.css.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source.css.snapis excluded by!**/*.snapand included by**crates/biome_css_syntax/src/generated/kind.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_syntax/src/generated/macros.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_syntax/src/generated/nodes.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_syntax/src/generated/nodes_mut.rsis 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.rscrates/biome_css_formatter/src/tailwind/any/source.rscrates/biome_css_parser/src/syntax/parse_error.rscrates/biome_css_formatter/src/tailwind/auxiliary/mod.rscrates/biome_css_formatter/src/tailwind/statements/source_at_rule.rsxtask/codegen/src/css_kinds_src.rscrates/biome_css_parser/src/lexer/mod.rscrates/biome_css_formatter/src/tailwind/auxiliary/source_inline.rscrates/biome_grit_patterns/src/grit_target_language/css_target_language/generated_mappings.rscrates/biome_css_parser/src/syntax/at_rule/tailwind.rscrates/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.rscrates/biome_css_formatter/src/tailwind/any/source.rscrates/biome_css_parser/src/syntax/parse_error.rscrates/biome_css_formatter/src/tailwind/auxiliary/mod.rscrates/biome_css_formatter/src/tailwind/statements/source_at_rule.rsxtask/codegen/src/css_kinds_src.rscrates/biome_css_parser/src/lexer/mod.rscrates/biome_css_formatter/src/tailwind/auxiliary/source_inline.rscrates/biome_grit_patterns/src/grit_target_language/css_target_language/generated_mappings.rscrates/biome_css_parser/src/syntax/at_rule/tailwind.rscrates/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.rscrates/biome_css_formatter/src/tailwind/auxiliary/source_inline.rscrates/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.rscrates/biome_css_formatter/src/tailwind/auxiliary/source_inline.rscrates/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.rscrates/biome_css_formatter/src/tailwind/auxiliary/source_inline.rscrates/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.rscrates/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
@sourcedirectives.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_inlineis 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
sourceis 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
pathtosourcealigns 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 showsTwSourceInlineincludes a trailing semicolon in its definition. However, here the semicolon is parsed at line 240 as part of the parentTwSourceAtRule. This mismatch suggests the ungram may need correction—the semicolon should belong toTwSourceAtRule, notTwSourceInline.Could you verify the ungram definition? Compare:
- ungram line 1964:
TwSourceInlineends with';'- ungram line 1953:
TwSourceAtRuleends 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 inTwSourceInline. Once the ungram is corrected (removing the semicolon fromTwSourceInline), runcargo codegen formatterto regenerate this file without the semicolon handling.crates/biome_css_formatter/src/generated.rs (2)
9636-9660: Formatter implementation verified—all variants covered without fallbacksThe 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 confirmedThe
FormatTwSourceInlinestruct is present and properly exported through the module hierarchy (tailwind/mod.rs→auxiliary/mod.rs→source_inline.rs). The generated FormatRule impl points to the right path and follows the established pattern.
CodSpeed Performance ReportMerging #7921 will not alter performanceComparing Summary
Footnotes
|
558eaaa to
ca923cb
Compare
ca923cb to
7b993cb
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: 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
notmodifier), 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
⛔ Files ignored due to path filters (12)
crates/biome_css_factory/src/generated/node_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_factory/src/generated/syntax_factory.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_formatter/tests/specs/css/tailwind/source-inline.css.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/error/tailwind/when-enabled/source.css.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/tailwind/simple.css.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-inline.css.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source-not.css.snapis excluded by!**/*.snapand included by**crates/biome_css_parser/tests/css_test_suite/ok/tailwind/source.css.snapis excluded by!**/*.snapand included by**crates/biome_css_syntax/src/generated/kind.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_syntax/src/generated/macros.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_syntax/src/generated/nodes.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_css_syntax/src/generated/nodes_mut.rsis 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.rscrates/biome_css_formatter/src/tailwind/statements/source_at_rule.rscrates/biome_css_formatter/src/tailwind/any/source.rscrates/biome_css_formatter/src/tailwind/auxiliary/mod.rscrates/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.rscrates/biome_css_formatter/src/tailwind/statements/source_at_rule.rscrates/biome_css_formatter/src/tailwind/any/source.rscrates/biome_css_formatter/src/tailwind/auxiliary/mod.rscrates/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.csscrates/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.rscrates/biome_css_formatter/src/tailwind/any/source.rscrates/biome_css_formatter/src/tailwind/auxiliary/mod.rscrates/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.rscrates/biome_css_formatter/src/tailwind/auxiliary/mod.rscrates/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.rscrates/biome_css_formatter/src/tailwind/auxiliary/mod.rscrates/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.rscrates/biome_css_formatter/src/tailwind/auxiliary/mod.rscrates/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.rscrates/biome_css_formatter/src/tailwind/auxiliary/mod.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.rscrates/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
pathtosourceand type change toAnyTwSourceproperly 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
TwSourceInlinedefinition correctly models theinline(...)syntax without a trailing semicolon, as the semicolon belongs to the containingTwSourceAtRule.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
pathtosourcecorrectly reflects the grammar change, and the formatting logic properly delegates to the newAnyTwSourcetype, 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 upPlumbing 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 correctAsFormat/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.
|
The CI failure looks unrelated. |
ematipico
left a 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.
Thank you!
Summary
This intentionally doesn't fix the
@importthings 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