2022-01-18 22:15:26 +01:00
|
|
|
((function_call
|
|
|
|
|
name: [
|
|
|
|
|
(identifier) @_cdef_identifier
|
|
|
|
|
(_ _ (identifier) @_cdef_identifier)
|
|
|
|
|
]
|
|
|
|
|
arguments: (arguments (string content: _ @c)))
|
|
|
|
|
(#eq? @_cdef_identifier "cdef"))
|
|
|
|
|
|
|
|
|
|
((function_call
|
|
|
|
|
name: (_) @_vimcmd_identifier
|
2023-04-24 15:43:31 +02:00
|
|
|
arguments: (arguments . (string content: _ @vim)))
|
|
|
|
|
(#any-of? @_vimcmd_identifier "vim.cmd" "vim.api.nvim_command" "vim.api.nvim_exec" "vim.api.nvim_exec2"))
|
2021-11-17 03:14:22 +01:00
|
|
|
|
2022-04-06 09:01:11 -07:00
|
|
|
((function_call
|
|
|
|
|
name: (_) @_vimcmd_identifier
|
|
|
|
|
arguments: (arguments (string content: _ @query) .))
|
2023-03-24 22:44:28 +01:00
|
|
|
(#any-of? @_vimcmd_identifier "vim.treesitter.query.set" "vim.treesitter.query.parse_query" "vim.treesitter.query.parse"))
|
2022-04-06 09:01:11 -07:00
|
|
|
|
2023-04-24 13:25:00 +02:00
|
|
|
; vim.rcprequest(123, "nvim_exec_lua", "return vim.api.nvim_buf_get_lines(0, 0, -1, false)", false)
|
|
|
|
|
((function_call
|
|
|
|
|
name: (_) @_vimcmd_identifier
|
2023-05-01 12:46:03 +09:00
|
|
|
arguments: (arguments . (_) . (string content: _ @_method) . (string content: _ @lua)))
|
2023-04-24 13:25:00 +02:00
|
|
|
(#any-of? @_vimcmd_identifier "vim.rpcrequest" "vim.rpcnotify")
|
2023-05-01 12:46:03 +09:00
|
|
|
(#eq? @_method "nvim_exec_lua"))
|
2023-04-24 13:25:00 +02:00
|
|
|
|
|
|
|
|
; highlight string as query if starts with `;; query`
|
2023-04-25 20:05:52 +06:00
|
|
|
(string content: _ @query (#lua-match? @query "^%s*;+%s?query"))
|
2022-08-20 13:33:45 +05:30
|
|
|
|
2023-03-19 08:09:12 -04:00
|
|
|
((comment) @luadoc
|
|
|
|
|
(#lua-match? @luadoc "[-][-][-][%s]*@")
|
|
|
|
|
(#offset! @luadoc 0 3 0 0))
|
|
|
|
|
|
2023-03-03 05:35:20 -05:00
|
|
|
; string.match("123", "%d+")
|
|
|
|
|
(function_call
|
|
|
|
|
(dot_index_expression
|
|
|
|
|
field: (identifier) @_method
|
|
|
|
|
(#any-of? @_method "find" "match"))
|
|
|
|
|
arguments: (arguments (_) . (string content: _ @luap)))
|
|
|
|
|
|
|
|
|
|
(function_call
|
|
|
|
|
(dot_index_expression
|
|
|
|
|
field: (identifier) @_method
|
2023-04-25 22:42:06 -04:00
|
|
|
(#any-of? @_method "gmatch" "gsub"))
|
2023-03-03 05:35:20 -05:00
|
|
|
arguments: (arguments (_) (string content: _ @luap)))
|
|
|
|
|
|
|
|
|
|
; ("123"):match("%d+")
|
|
|
|
|
(function_call
|
|
|
|
|
(method_index_expression
|
|
|
|
|
method: (identifier) @_method
|
|
|
|
|
(#any-of? @_method "find" "match"))
|
|
|
|
|
arguments: (arguments . (string content: _ @luap)))
|
|
|
|
|
|
|
|
|
|
(function_call
|
|
|
|
|
(method_index_expression
|
|
|
|
|
method: (identifier) @_method
|
|
|
|
|
(#any-of? @_method "gmatch" "gsub"))
|
|
|
|
|
arguments: (arguments (string content: _ @luap)))
|
|
|
|
|
|
2021-04-30 13:22:12 -05:00
|
|
|
(comment) @comment
|