Skip to content
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

fix(css_formatter): don't wrap selector identation after css comments #4614

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

fireairforce
Copy link
Member

@fireairforce fireairforce commented Nov 22, 2024

Summary

closes: #4575

I add special judge for the case like:

/* 1some medium long comment */
.line1 selector,
/* 2some medium long comment */
.line1 selector,
/* 3some medium long comment */
div selector {
  background: green;
}

if there was a selector, it contains comments before, it will don't be wrapped by the ident(So i add judge in this case to remove the ident for the selector).

Test Plan

I add test case.

@github-actions github-actions bot added A-Formatter Area: formatter L-CSS Language: CSS labels Nov 22, 2024
Copy link

codspeed-hq bot commented Nov 22, 2024

CodSpeed Performance Report

Merging #4614 will not alter performance

Comparing fireairforce:fix-4575 (3cb170b) with main (4848994)

Summary

✅ 97 untouched benchmarks

@github-actions github-actions bot added the A-Changelog Area: changelog label Nov 24, 2024
@fireairforce fireairforce marked this pull request as ready for review November 24, 2024 16:12
@@ -1,7 +1,6 @@
---
source: crates/biome_formatter_test/src/snapshot_builder.rs
info: css/issue_3229.css
snapshot_kind: text
Copy link
Member

Choose a reason for hiding this comment

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

It seems your local version of cargo-insta is outdated. You can update it using just update-tools, or just cargo install cargo-insta

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the reminder, I have updated it

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages and removed A-Formatter Area: formatter L-CSS Language: CSS A-Changelog Area: changelog labels Nov 26, 2024
@github-actions github-actions bot added A-Formatter Area: formatter L-CSS Language: CSS A-Changelog Area: changelog and removed A-Linter Area: linter labels Nov 26, 2024

.aRule {
Copy link
Member Author

Choose a reason for hiding this comment

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

this case i am align with prettier here:

img_v3_02gv_de2c359c-a5a7-4c98-b048-df2f673b915g

@fireairforce fireairforce merged commit cd1c8ec into biomejs:main Nov 26, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Formatter Area: formatter L-CSS Language: CSS L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Selector indentation after CSS comment wrap
2 participants