Skip to content

refactor(css): replace typed bogus nodes with CssBogus#9436

Closed
denbezrukov wants to merge 3 commits intomainfrom
db/bogus-css
Closed

refactor(css): replace typed bogus nodes with CssBogus#9436
denbezrukov wants to merge 3 commits intomainfrom
db/bogus-css

Conversation

@denbezrukov
Copy link
Contributor

Summary

Replaces CSS typed bogus nodes with the shared CssBogus node to reduce the number of CSS syntax kinds.

The CSS grammar had grown enough SCSS and at-rule support that it exceeded the fixed SyntaxKindSet capacity in
biome_rowan, which forced an undesirable global bitset-size bump.

Test Plan

cargo test -p biome_css_parser
cargo test -p biome_css_formatter

@changeset-bot
Copy link

changeset-bot bot commented Mar 10, 2026

⚠️ No Changeset found

Latest commit: f7ddaa7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions github-actions bot added A-Linter Area: linter A-Parser Area: parser A-Formatter Area: formatter A-Tooling Area: internal tools L-CSS Language: CSS and super languages labels Mar 10, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2026

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 53078 53078 0
Passed 51858 51858 0
Failed 1178 1178 0
Panics 42 42 0
Coverage 97.70% 97.70% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 38 38 0
Passed 37 37 0
Failed 1 1 0
Panics 0 0 0
Coverage 97.37% 97.37% 0.00%

markdown/commonmark

Test result main count This PR count Difference
Total 652 652 0
Passed 652 652 0
Failed 0 0 0
Panics 0 0 0
Coverage 100.00% 100.00% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 5466 5466 0
Passed 1915 1915 0
Failed 3551 3551 0
Panics 0 0 0
Coverage 35.03% 35.03% 0.00%

ts/babel

Test result main count This PR count Difference
Total 636 636 0
Passed 568 568 0
Failed 68 68 0
Panics 0 0 0
Coverage 89.31% 89.31% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 18875 18875 0
Passed 13014 13014 0
Failed 5860 5860 0
Panics 1 1 0
Coverage 68.95% 68.95% 0.00%

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 10, 2026

Merging this PR will improve performance by 12.75%

⚡ 1 improved benchmark
✅ 28 untouched benchmarks
⏩ 187 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
css_analyzer[tachyons_11778168428173736564.css] 162.8 ms 144.4 ms +12.75%

Comparing db/bogus-css (f7ddaa7) with main (795bad4)

Open in CodSpeed

Footnotes

  1. 187 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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6cad85c2-c9dc-4c30-9de4-2baa187fd764

📥 Commits

Reviewing files that changed from the base of the PR and between 40814fa and f7ddaa7.

⛔ Files ignored due to path filters (1)
  • crates/biome_css_analyze/tests/specs/suspicious/noIrregularWhitespace/invalid.css.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (1)
  • crates/biome_css_analyze/src/lint/suspicious/no_irregular_whitespace.rs

Walkthrough

This PR collapses many specialised "bogus" CSS variants into a single CssBogus variant across grammar, parser, analyzer and formatter crates. It updates match arms and parser recovery kinds to use CssBogus/CSS_BOGUS, removes numerous boilerplate bogus-formatters and their generated impls, and simplifies the codegen/kinds to expose the unified bogus alternative instead of many CssBogusXxx variants. No behavioural control-flow changes beyond variant/name unification are introduced.

Possibly related PRs

Suggested labels

L-SCSS

Suggested reviewers

  • ematipico
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarises the main change: replacing typed bogus CSS nodes with a unified CssBogus node.
Description check ✅ Passed The description is well-related to the changeset, explaining the motivation (reducing syntax kinds to avoid bitset capacity issues) and providing a test plan.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch db/bogus-css

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Formatter Area: formatter A-Linter Area: linter A-Parser Area: parser A-Tooling Area: internal tools L-CSS Language: CSS and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant