File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ impl Formatter {
5353 . unwrap ( ) ;
5454 let tree = parser. parse ( & content, None ) . unwrap ( ) ;
5555 let mut input_tree = GdTree :: from_ts_tree ( & tree, content. as_bytes ( ) ) ;
56- input_tree. postprocess ( ) ;
5756
5857 Self {
5958 content,
@@ -145,6 +144,7 @@ impl Formatter {
145144 #[ inline( always) ]
146145 fn finish ( mut self ) -> Result < String , Box < dyn std:: error:: Error > > {
147146 if self . config . safe {
147+ self . input_tree . postprocess ( ) ;
148148 self . tree = self . parser . parse ( & self . content , None ) . unwrap ( ) ;
149149
150150 let output_tree = GdTree :: from_ts_tree ( & self . tree , self . content . as_bytes ( ) ) ;
@@ -587,8 +587,9 @@ impl GdTree {
587587 if child. grammar_name != "annotation" {
588588 return None ;
589589 }
590- let annotation_name =
591- self . nodes [ child. children [ 0 ] ] . text . as_deref ( ) . unwrap ( ) ;
590+ let Some ( annotation_name) = & self . nodes [ child. children [ 0 ] ] . text else {
591+ return None ;
592+ } ;
592593 if annotation_name != "onready" && annotation_name != "export" {
593594 return None ;
594595 }
You can’t perform that action at this time.
0 commit comments