Skip to content

Commit 792e0c9

Browse files
committed
Fix variable declaration after function getting placed inside function (or class)
Part of #44
1 parent 4e3830d commit 792e0c9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

queries/gdscript.scm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
; FUNCTIONS
4343
(function_definition (name) @append_antispace)
44-
(function_definition (body) @prepend_hardline)
44+
(function_definition (body) @prepend_hardline @append_hardline)
4545
; This forces adding a line above all functions during the topiary formatting
4646
; pass. Without this cases like "func a(): pass" would not get a line above them
4747
; and get merged together, preventing the post-processing step in formatter.rs
@@ -72,7 +72,7 @@
7272
(parameters (([(typed_parameter) (typed_default_parameter) (identifier) (default_parameter)]) @append_delimiter (#delimiter! ",") . ","? @do_nothing . (comment)? . ")") (#multi_line_only!))
7373

7474
; CLASS DEFINITIONS
75-
(class_definition (body) @prepend_hardline)
75+
(class_definition (body) @prepend_hardline @append_hardline)
7676
(class_name_statement) @append_space
7777
(class_definition) @prepend_hardline
7878
(source

0 commit comments

Comments
 (0)