1use crate::language::TexLanguage;
2use oak_core::tree::RedNode;
3use oak_pretty_print::{FormatConfig, FormatOutput, FormatResult, Formatter};
4
5pub struct TexFormatter {
7 inner: Formatter<TexLanguage>,
8}
9
10impl TexFormatter {
11 pub fn new(config: FormatConfig) -> Self {
12 Self { inner: Formatter::new(config) }
13 }
14
15 pub fn format(&mut self, root: &RedNode<TexLanguage>, source: &str) -> FormatResult<FormatOutput> {
16 self.inner.format(root, source)
17 }
18}
19
20impl Default for TexFormatter {
21 fn default() -> Self {
22 Self::new(FormatConfig::default())
23 }
24}