Skip to content

Commit e347966

Browse files
committed
improve printing comments for if statement
1 parent faa2033 commit e347966

File tree

1 file changed

+1
-1
lines changed
  • crates/oxc_formatter/src/write

1 file changed

+1
-1
lines changed

crates/oxc_formatter/src/write/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ impl<'a> Format<'a> for FormatCommentForEmptyStatement<'a, '_> {
642642
struct FormatTestOfIfAndWhileStatement<'a, 'b>(&'b AstNode<'a, Expression<'a>>);
643643
impl<'a> Format<'a> for FormatTestOfIfAndWhileStatement<'a, '_> {
644644
fn fmt(&self, f: &mut Formatter<'_, 'a>) -> FormatResult<()> {
645-
FormatExpressionWithoutTrailingComments(self.0).fmt(f);
645+
FormatNodeWithoutTrailingComments(self.0).fmt(f);
646646
let comments = f.context().comments().comments_before_character(self.0.span().end, b')');
647647
if !comments.is_empty() {
648648
write!(f, [space(), FormatTrailingComments::Comments(comments)])?;

0 commit comments

Comments
 (0)