aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/lua/injections.scm
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-09-06 10:10:01 +0200
committerGitHub <noreply@github.com>2022-09-06 10:10:01 +0200
commit5b8d6e0b3200c5cb9d98cbdb4ed0afe2b4edd38d (patch)
tree23aac48c4aff31236341260942ceeb7b42fc90ab /runtime/queries/lua/injections.scm
parent4bf005e9fdfb57397475b2663a3651faa83886ff (diff)
parent0822896efcf0da7002e323369fdc1e4a15ad1d57 (diff)
downloadrneovim-5b8d6e0b3200c5cb9d98cbdb4ed0afe2b4edd38d.tar.gz
rneovim-5b8d6e0b3200c5cb9d98cbdb4ed0afe2b4edd38d.tar.bz2
rneovim-5b8d6e0b3200c5cb9d98cbdb4ed0afe2b4edd38d.zip
Merge pull request #15391 from vigoux/ts-lua-builtin
feat(treesitter): highlighting for core languages, enabled for Lua
Diffstat (limited to 'runtime/queries/lua/injections.scm')
-rw-r--r--runtime/queries/lua/injections.scm22
1 files changed, 22 insertions, 0 deletions
diff --git a/runtime/queries/lua/injections.scm b/runtime/queries/lua/injections.scm
new file mode 100644
index 0000000000..0e67329139
--- /dev/null
+++ b/runtime/queries/lua/injections.scm
@@ -0,0 +1,22 @@
+((function_call
+ name: [
+ (identifier) @_cdef_identifier
+ (_ _ (identifier) @_cdef_identifier)
+ ]
+ arguments: (arguments (string content: _ @c)))
+ (#eq? @_cdef_identifier "cdef"))
+
+((function_call
+ name: (_) @_vimcmd_identifier
+ arguments: (arguments (string content: _ @vim)))
+ (#any-of? @_vimcmd_identifier "vim.cmd" "vim.api.nvim_command" "vim.api.nvim_exec" "vim.api.nvim_cmd"))
+
+; ((function_call
+; name: (_) @_vimcmd_identifier
+; arguments: (arguments (string content: _ @query) .))
+; (#eq? @_vimcmd_identifier "vim.treesitter.query.set_query"))
+
+; ;; highlight string as query if starts with `;; query`
+; ((string ("string_content") @query) (#lua-match? @query "^%s*;+%s?query"))
+
+; (comment) @comment