From e4c09ecbcfc39f58b27bf015b26eb3137dc33673 Mon Sep 17 00:00:00 2001 From: Mitchell Hanberg Date: Tue, 2 May 2023 08:07:05 -0400 Subject: [PATCH 1/2] 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)))) From 0f2a72bd54b5de24f6c4f496c466356fde4f6464 Mon Sep 17 00:00:00 2001 From: Mitchell Hanberg Date: Tue, 2 May 2023 09:53:54 -0400 Subject: [PATCH 2/2] chore: update README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 89bb75c6..2b37d143 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ Requires 0.8 ```lua { "elixir-tools/elixir-tools.nvim", + event = { "BufReadPre", "BufNewFile" }, ft = { "elixir", "eex", "heex", "surface" }, config = function() local elixir = require("elixir")