File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6161
6262; MULTI-LINE ARGUMENTS (in function calls)
6363(arguments "," @append_hardline . (comment)? @do_nothing (#multi_line_only!))
64- ; uncomment for double indentation in multiline function calls
65- ; (arguments (_) @prepend_indent_start @append_indent_end )
6664(arguments
6765 "(" @append_hardline @append_indent_start
6866 ")" @prepend_hardline @prepend_indent_end
106104(constructor_definition (body) @prepend_hardline )
107105
108106; OPERATORS
107+ ; Preserve user-inserted line breaks in chained attribute/method calls.
108+ (attribute "." @prepend_input_softline @prepend_antispace )
109+
109110; Allow line breaks around binary operators for long expressions
110111; This means that if the programmer has a long expression, they can break it up by wrapping something on a line
111112(binary_operator
Original file line number Diff line number Diff line change 1+ # Based on https://github.com/GDQuest/GDScript-formatter/issues/217
2+ func _test () -> void :
3+ print (
4+ "ABCDEF"
5+ .replace ("A" , "111111111111111111111111111111111111111111111111" )
6+ .replace ("B" , "2" )
7+ .replace ("C" , "3" ),
8+ )
9+
10+ foo (
11+ "ABCDEF"
12+ .replace (
13+ "A" ,
14+ "111111111111111111111111111111111111111111111111" ,
15+ )
16+ .replace ("B" , "2" )
17+ .replace ("C" , "3" ),
18+ "second argument" ,
19+ )
Original file line number Diff line number Diff line change 1+ # Based on https://github.com/GDQuest/GDScript-formatter/issues/217
2+ func _test () -> void :
3+ print ("ABCDEF"
4+ .replace ("A" , "111111111111111111111111111111111111111111111111" )
5+ .replace ("B" , "2" )
6+ .replace ("C" , "3" ))
7+
8+ foo (
9+ "ABCDEF"
10+ .replace (
11+ "A" ,
12+ "111111111111111111111111111111111111111111111111"
13+ )
14+ .replace ("B" , "2" )
15+ .replace ("C" , "3" ),
16+ "second argument"
17+ )
You can’t perform that action at this time.
0 commit comments