neovim/runtime/queries/lua/injections.scm

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
1.2 KiB
Scheme
Raw Normal View History

2022-09-04 07:37:24 -07:00
((function_call
name: [
(identifier) @_cdef_identifier
(_ _ (identifier) @_cdef_identifier)
]
arguments:
(arguments
(string content: _ @injection.content)))
(#set! injection.language "c")
2022-09-04 07:37:24 -07:00
(#eq? @_cdef_identifier "cdef"))
((function_call
name: (_) @_vimcmd_identifier
arguments: (arguments (string content: _ @injection.content)))
(#set! injection.language "vim")
(#any-of? @_vimcmd_identifier "vim.cmd" "vim.api.nvim_command" "vim.api.nvim_command" "vim.api.nvim_exec2"))
((function_call
name: (_) @_vimcmd_identifier
arguments: (arguments (string content: _ @injection.content) .))
(#set! injection.language "query")
(#any-of? @_vimcmd_identifier "vim.treesitter.query.set" "vim.treesitter.query.parse"))
2022-09-04 07:37:24 -07:00
((function_call
name: (_) @_vimcmd_identifier
arguments: (arguments . (_) . (string content: _ @_method) . (string content: _ @injection.content)))
(#any-of? @_vimcmd_identifier "vim.rpcrequest" "vim.rpcnotify")
(#eq? @_method "nvim_exec_lua")
(#set! injection.language "lua"))
;; highlight string as query if starts with `;; query`
(string content: _ @injection.content
(#lua-match? @injection.content "^%s*;+%s?query")
(#set! injection.language "query"))
2022-09-04 07:37:24 -07:00