From a744ed1b274b586a00dcb39dc0da7ba264758efb Mon Sep 17 00:00:00 2001 From: Stephen Bolton Date: Sun, 5 Feb 2023 15:56:46 -0500 Subject: [PATCH] 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. --- queries/elixir/highlights.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/queries/elixir/highlights.scm b/queries/elixir/highlights.scm index c3aee40c7..d87afcf1b 100644 --- a/queries/elixir/highlights.scm +++ b/queries/elixir/highlights.scm @@ -111,9 +111,10 @@ "defp" "defprotocol" "defstruct" -)) (arguments [ - (identifier) @function - (binary_operator left: (identifier) @function operator: "when")])?) + )) + (arguments [ + (call (identifier) @function) + (binary_operator left: (call target: (identifier) @function) operator: "when")])?) ; Kernel Keywords & Special Forms (call target: ((identifier) @keyword (#any-of? @keyword