File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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) ]
You can’t perform that action at this time.
0 commit comments