Skip to content

Commit

Permalink
Corrected function rewrite queries
Browse files Browse the repository at this point in the history
  • Loading branch information
Xophmeister committed Jan 3, 2025
1 parent 4bf0286 commit 4d407e6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion topiary-queries/queries/bash.scm
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,18 @@
; statements and test commands as function bodies.

(function_definition
body: _ @prepend_space @append_hardline
body: (_) @prepend_space @append_hardline
)

(function_definition
name: (_) @append_delimiter _? @do_nothing
body: _

(#delimiter! "()")
)

; NOTE This rule must appear after the above, where the "()" are
; appended, if necessary
(function_definition
.
"function" @delete
Expand Down

0 comments on commit 4d407e6

Please sign in to comment.