Skip to content

Commit

Permalink
fix(css_formatter): don't ident css selector when comments before
Browse files Browse the repository at this point in the history
  • Loading branch information
fireairforce committed Oct 26, 2024
1 parent ee55b68 commit a5739ec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ impl FormatRule<CssRelativeSelectorList> for FormatCssRelativeSelectorList {
if let Some(computed_selector) =
relative_selector.selector()?.as_css_compound_selector()
{
let simple_selector = computed_selector
.simple_selector()
.unwrap()
.as_css_type_selector()
.unwrap()
.ident()?
.value_token()?;
has_comments_before = simple_selector.has_leading_comments();
if let Some(simple_selector) = computed_selector.simple_selector() {
if let Some(type_selector) = simple_selector.as_css_type_selector() {
let value_token = type_selector.ident()?.value_token()?;
if value_token.has_leading_comments() {
has_comments_before = true;
}
}
}
}
}

Expand Down
2 changes: 0 additions & 2 deletions crates/biome_css_formatter/src/utils/component_value_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ where
ValueListLayout::PreserveInline => {
let content = format_once(|f| {
if has_newline {
println!("fuck here1");
// Add line break before the first element if we have more than two lines.
write!(f, [hard_line_break()])?;
}
Expand All @@ -92,7 +91,6 @@ where
}
ValueListLayout::OnePerLine => {
let content = format_once(|f| {
println!("fuck here2");
write!(f, [hard_line_break()])?;
write!(f, [values])
});
Expand Down

This file was deleted.

0 comments on commit a5739ec

Please sign in to comment.