From e4c09ecbcfc39f58b27bf015b26eb3137dc33673 Mon Sep 17 00:00:00 2001 From: Mitchell Hanberg Date: Tue, 2 May 2023 08:07:05 -0400 Subject: [PATCH] feat(treesitter): injections - highlight the template argument of `EEx.function_from_string` as `eex` - highlight the argument of `execute` as `sql` (Ecto migrations). Closes #9 --- queries/elixir/injections.scm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 queries/elixir/injections.scm diff --git a/queries/elixir/injections.scm b/queries/elixir/injections.scm new file mode 100644 index 00000000..7b9c6083 --- /dev/null +++ b/queries/elixir/injections.scm @@ -0,0 +1,15 @@ +; extends + +(call + target: ((identifier) @_identifier (#eq? @_identifier "execute")) + (arguments + (string + (quoted_content) @sql))) + +((call + target: (dot + left: (alias) @_mod (#eq? @_mod "EEx") + right: (identifier) @_func (#eq? @_func "function_from_string")) + (arguments + (string + (quoted_content) @eex))))