use sipha::red::SyntaxNode;
#[derive(Clone, Copy, Debug, PartialEq, Eq, Default)]
pub enum IndentStyle {
#[default]
Tabs,
Spaces(u32),
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Default)]
pub enum BraceStyle {
#[default]
SameLine,
NextLine,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Default)]
pub enum SemicolonStyle {
#[default]
Always,
Omit,
}
#[derive(Clone, Debug)]
pub struct FormatterOptions {
pub preserve_comments: bool,
pub parenthesize_expressions: bool,
pub annotate_types: bool,
pub signature_roots: Option<Vec<SyntaxNode>>,
pub canonical_format: bool,
pub indent_style: IndentStyle,
pub brace_style: BraceStyle,
pub semicolon_style: SemicolonStyle,
}
impl Default for FormatterOptions {
fn default() -> Self {
Self {
preserve_comments: true,
parenthesize_expressions: false,
annotate_types: false,
signature_roots: None,
canonical_format: false,
indent_style: IndentStyle::default(),
brace_style: BraceStyle::default(),
semicolon_style: SemicolonStyle::default(),
}
}
}