Skip to content

Commit 8b6917c

Browse files
committed
Revert "remove preprocessing"
This reverts commit 3850efe696cbe71eff4c96b2b497e2357c9e3d20.
1 parent d1eacad commit 8b6917c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/formatter.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub fn format_gdscript_with_config(
3232
) -> Result<String, Box<dyn std::error::Error>> {
3333
let mut formatter = Formatter::new(content.to_owned(), config.clone());
3434

35-
formatter.format()?.postprocess().reorder();
35+
formatter.preprocess().format()?.postprocess().reorder();
3636
formatter.finish()
3737
}
3838

@@ -121,6 +121,14 @@ impl Formatter {
121121
self
122122
}
123123

124+
/// This function runs over the content before going through topiary.
125+
/// It is used to prepare the content for formatting or save performance by
126+
/// pre-applying rules that could be performance-intensive through topiary.
127+
#[inline(always)]
128+
fn preprocess(&mut self) -> &mut Self {
129+
self
130+
}
131+
124132
/// This function runs over the content after going through topiary. We use it
125133
/// to clean up/balance out the output.
126134
#[inline(always)]

0 commit comments

Comments
 (0)