mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 17:30:08 -04:00
injections(lua): highlight Lua code in vim.rpcrequest and vim.rpcnotify
This commit is contained in:
parent
77ffc7edbe
commit
72e2e2df86
1 changed files with 8 additions and 1 deletions
|
|
@ -16,7 +16,14 @@
|
||||||
arguments: (arguments (string content: _ @query) .))
|
arguments: (arguments (string content: _ @query) .))
|
||||||
(#any-of? @_vimcmd_identifier "vim.treesitter.query.set" "vim.treesitter.query.parse_query" "vim.treesitter.query.parse"))
|
(#any-of? @_vimcmd_identifier "vim.treesitter.query.set" "vim.treesitter.query.parse_query" "vim.treesitter.query.parse"))
|
||||||
|
|
||||||
;; highlight string as query if starts with `;; query`
|
; vim.rcprequest(123, "nvim_exec_lua", "return vim.api.nvim_buf_get_lines(0, 0, -1, false)", false)
|
||||||
|
((function_call
|
||||||
|
name: (_) @_vimcmd_identifier
|
||||||
|
arguments: (arguments . (_) . (string) @_method . (string content: _ @lua)))
|
||||||
|
(#any-of? @_vimcmd_identifier "vim.rpcrequest" "vim.rpcnotify")
|
||||||
|
(#any-of? @_method "\"nvim_exec_lua\"" "'nvim_exec_lua'" "[[nvim_exec_lua]]"))
|
||||||
|
|
||||||
|
; highlight string as query if starts with `;; query`
|
||||||
((string ("string_content") @query) (#lua-match? @query "^%s*;+%s?query"))
|
((string ("string_content") @query) (#lua-match? @query "^%s*;+%s?query"))
|
||||||
|
|
||||||
((comment) @luadoc
|
((comment) @luadoc
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue