typstyle_core/pretty/
style.rs1use typst_syntax::{SyntaxKind, SyntaxNode, ast::*};
2
3use crate::ext::StrExt;
4
5#[derive(Debug, Clone, Copy, PartialEq, Eq)]
7pub enum FoldStyle {
8 Fit,
10 Never,
12 Always,
14 Compact,
16}
17
18pub fn is_multiline_flavored(node: &SyntaxNode) -> bool {
20 for child in node.children() {
21 if child.kind() == SyntaxKind::Space {
22 return child.leaf_text().has_linebreak();
23 }
24 if child.is::<Expr>() || child.children().len() > 0 {
26 break;
27 }
28 }
29 false
30}