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