Fix elixir @function captures

When viewing the previous rule in the `TSPlayground` the `@function`
captures were not actually matching. This led all functions to get the
`@function.call` group applied to them. This change makes it so that the
capture now works and where functions are defined will get the
`@function` group.
This commit is contained in:
Stephen Bolton 2023-02-05 15:56:46 -05:00 committed by Amaan Qureshi
parent 028b7dfbdd
commit a744ed1b27

View file

@ -111,9 +111,10 @@
"defp" "defp"
"defprotocol" "defprotocol"
"defstruct" "defstruct"
)) (arguments [ ))
(identifier) @function (arguments [
(binary_operator left: (identifier) @function operator: "when")])?) (call (identifier) @function)
(binary_operator left: (call target: (identifier) @function) operator: "when")])?)
; Kernel Keywords & Special Forms ; Kernel Keywords & Special Forms
(call target: ((identifier) @keyword (#any-of? @keyword (call target: ((identifier) @keyword (#any-of? @keyword