@@ -194,14 +194,15 @@ fn has_own_annotations_child(node: tree_sitter::Node) -> bool {
194194///
195195/// We want these specific annotations to stay on the same line as the variable
196196/// declaration they annotate.
197- fn is_export_or_onready_annotation ( source : & str , annotation : tree_sitter:: Node ) -> bool {
197+ fn is_annotation_that_should_stay_inline ( source : & str , annotation : tree_sitter:: Node ) -> bool {
198198 let mut child_index = 0 ;
199199 while child_index < annotation. child_count ( ) {
200200 if let Some ( child) = annotation. child ( child_index as u32 )
201201 && GDScriptNodeKind :: get_kind_from_ast_node ( child) == GDScriptNodeKind :: Identifier
202202 {
203203 let annotation_name = & source[ child. start_byte ( ) ..child. end_byte ( ) ] ;
204- return ( annotation_name. starts_with ( "export" ) && annotation_name != "export_group" )
204+ return ( annotation_name. starts_with ( "export" )
205+ && ![ "export_group" , "export_subgroup" ] . contains ( & annotation_name) )
205206 || annotation_name == "onready" ;
206207 }
207208 child_index += 1 ;
@@ -1269,7 +1270,7 @@ fn output_pending_before_declaration(
12691270 while pending_index < pending. len ( ) {
12701271 let ( pending_node, _) = pending[ pending_index] ;
12711272 if GDScriptNodeKind :: get_kind_from_ast_node ( pending_node) == GDScriptNodeKind :: Annotation
1272- && !is_export_or_onready_annotation ( source, pending_node)
1273+ && !is_annotation_that_should_stay_inline ( source, pending_node)
12731274 {
12741275 pending_annotations_can_inline = false ;
12751276 break ;
@@ -1286,7 +1287,7 @@ fn output_pending_before_declaration(
12861287 && newline_count_from_last_pending == 1
12871288 && pending. last ( ) . is_some_and ( |( annotation, _) | {
12881289 GDScriptNodeKind :: get_kind_from_ast_node ( * annotation) == GDScriptNodeKind :: Annotation
1289- && is_export_or_onready_annotation ( source, * annotation)
1290+ && is_annotation_that_should_stay_inline ( source, * annotation)
12901291 } ) ;
12911292
12921293 // Walk backward from the end of pending: comments on their own line that
@@ -3275,7 +3276,7 @@ fn process_separator_between_sibling_nodes(
32753276 let mut annotation_index = 0 ;
32763277 while annotation_index < previous_child. child_count ( ) {
32773278 if let Some ( annotation) = previous_child. child ( annotation_index as u32 )
3278- && !is_export_or_onready_annotation ( source, annotation)
3279+ && !is_annotation_that_should_stay_inline ( source, annotation)
32793280 {
32803281 annotations_can_inline = false ;
32813282 break ;
0 commit comments