Skip to content

Commit 5e71a13

Browse files
authored
Merge pull request #56 from shadr/inline-comments-in-function-calls
Fix inline comments in function calls
2 parents 31a64fb + f06235d commit 5e71a13

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

queries/gdscript.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
(parameters "," @delete . ")" (#single_line_only!))
6060

6161
; MULTI-LINE ARGUMENTS (in function calls)
62-
(arguments "," @append_hardline (#multi_line_only!))
62+
(arguments "," @append_hardline . (comment)? @do_nothing (#multi_line_only!))
6363
; uncomment for double indentation in multiline function calls
6464
; (arguments (_) @prepend_indent_start @append_indent_end)
6565
(arguments

tests/expected/comments_inline.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,9 @@ func foo(): # func comment
6262
var lam = func(): # lambda comment
6363
pass
6464

65+
bar(
66+
a, # function call inline comment
67+
b,
68+
)
69+
6570
return # function trailing comment at end

tests/input/comments_inline.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,9 @@ func foo(): # func comment
5959
var lam = func(): # lambda comment
6060
pass
6161

62+
bar(
63+
a, # function call inline comment
64+
b,
65+
)
66+
6267
return # function trailing comment at end

0 commit comments

Comments
 (0)