Skip to content

Commit

Permalink
feat(format/html): port JsxChildList formatting to HtmlElementList
Browse files Browse the repository at this point in the history
  • Loading branch information
dyc3 committed Sep 17, 2024
1 parent 7e6de58 commit dacc167
Show file tree
Hide file tree
Showing 11 changed files with 1,276 additions and 6 deletions.
19 changes: 17 additions & 2 deletions crates/biome_html_formatter/src/comments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,21 @@ impl FormatRule<SourceComment<HtmlLanguage>> for FormatHtmlLeadingComment {
}
}

#[derive(Default)]
pub struct FormatHtmlTrailingComment;

impl FormatRule<SourceComment<HtmlLanguage>> for FormatHtmlTrailingComment {
type Context = HtmlFormatContext;

fn fmt(
&self,
comment: &SourceComment<HtmlLanguage>,
f: &mut Formatter<Self::Context>,
) -> FormatResult<()> {
write!(f, [comment.piece().as_piece()])
}
}

#[derive(Eq, PartialEq, Copy, Clone, Debug, Default)]
pub struct HtmlCommentStyle;

Expand All @@ -82,8 +97,8 @@ impl CommentStyle for HtmlCommentStyle {

fn place_comment(
&self,
_comment: DecoratedComment<Self::Language>,
comment: DecoratedComment<Self::Language>,
) -> CommentPlacement<Self::Language> {
todo!();
CommentPlacement::Default(comment)
}
}
Loading

0 comments on commit dacc167

Please sign in to comment.