mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
feat(prettier) print for in statements (#1386)
This commit is contained in:
parent
b613eab2f0
commit
0195affb5a
1 changed files with 10 additions and 1 deletions
|
|
@ -183,7 +183,16 @@ impl<'a> Format<'a> for ForStatementInit<'a> {
|
|||
|
||||
impl<'a> Format<'a> for ForInStatement<'a> {
|
||||
fn format(&self, p: &mut Prettier<'a>) -> Doc<'a> {
|
||||
Doc::Line
|
||||
let mut parts = p.vec();
|
||||
|
||||
parts.push(ss!("for ("));
|
||||
parts.push(format!(p, self.left));
|
||||
parts.push(ss!(" in "));
|
||||
parts.push(format!(p, self.right));
|
||||
parts.push(ss!(")"));
|
||||
parts.push(format!(p, self.body));
|
||||
|
||||
Doc::Group(parts)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue