fix: implement ToFormatElement for JsExpressionSnipped
MODIFY
crates/rome_formatter/src/js/auxiliary/expression_snipped.rs
crates/rome_formatter/src/js/auxiliary/expression_snipped.rs
-use crate::{FormatElement, FormatResult, Formatter, ToFormatElement};
-use rslint_parser::{ast::JsExpressionSnipped, AstNode};
+use crate::{
+ format_elements, formatter_traits::FormatTokenAndNode, FormatElement, FormatResult, Formatter,
+ ToFormatElement,
+};
+use rslint_parser::ast::JsExpressionSnipped;
+
impl ToFormatElement for JsExpressionSnipped {
fn to_format_element(&self, formatter: &Formatter) -> FormatResult<FormatElement> {
- Ok(formatter.format_verbatim(self.syntax()))
+ Ok(format_elements![
+ self.expression().format(formatter)?,
+ self.eof_token().format(formatter)?,
+ ])
}
}

fix: implement ToFormatElement for JsExpressionSnipped (#2097)