diff options
author | Christian Clason <c.clason@uni-graz.at> | 2023-05-13 12:37:22 +0200 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2023-05-15 14:13:31 +0200 |
commit | 0dbed7132b559b3e8419c0e59ca553e5921d6a90 (patch) | |
tree | fcc4b598f4a557332e6308a61bc90a3e7804c5a3 | |
parent | 33687f5e87a0f048f7bc02d4658e58ef8cc0fd49 (diff) | |
download | rneovim-0dbed7132b559b3e8419c0e59ca553e5921d6a90.tar.gz rneovim-0dbed7132b559b3e8419c0e59ca553e5921d6a90.tar.bz2 rneovim-0dbed7132b559b3e8419c0e59ca553e5921d6a90.zip |
build(deps): update lua parser and queries
-rw-r--r-- | cmake.deps/deps.txt | 4 | ||||
-rw-r--r-- | runtime/queries/lua/highlights.scm | 10 | ||||
-rw-r--r-- | runtime/queries/lua/injections.scm | 10 |
3 files changed, 20 insertions, 4 deletions
diff --git a/cmake.deps/deps.txt b/cmake.deps/deps.txt index 5c9d29bea6..385ede0e42 100644 --- a/cmake.deps/deps.txt +++ b/cmake.deps/deps.txt @@ -52,8 +52,8 @@ LIBICONV_SHA256 ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178 TREESITTER_C_URL https://github.com/tree-sitter/tree-sitter-c/archive/v0.20.2.tar.gz TREESITTER_C_SHA256 af66fde03feb0df4faf03750102a0d265b007e5d957057b6b293c13116a70af2 -TREESITTER_LUA_URL https://github.com/MunifTanjim/tree-sitter-lua/archive/v0.0.14.tar.gz -TREESITTER_LUA_SHA256 930d0370dc15b66389869355c8e14305b9ba7aafd36edbfdb468c8023395016d +TREESITTER_LUA_URL https://github.com/MunifTanjim/tree-sitter-lua/archive/v0.0.17.tar.gz +TREESITTER_LUA_SHA256 8963fd0a185d786c164dfca3824941c7eaec497ce49a3a0bc24bf753f5e0e59c TREESITTER_VIM_URL https://github.com/neovim/tree-sitter-vim/archive/v0.3.0.tar.gz TREESITTER_VIM_SHA256 403acec3efb7cdb18ff3d68640fc823502a4ffcdfbb71cec3f98aa786c21cbe2 TREESITTER_VIMDOC_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v2.0.0.tar.gz diff --git a/runtime/queries/lua/highlights.scm b/runtime/queries/lua/highlights.scm index 5fbf8a1833..537a171441 100644 --- a/runtime/queries/lua/highlights.scm +++ b/runtime/queries/lua/highlights.scm @@ -127,8 +127,14 @@ (identifier) @variable +((identifier) @constant.builtin + (#eq? @constant.builtin "_VERSION")) + ((identifier) @variable.builtin - (#any-of? @variable.builtin "_G" "_VERSION" "debug" "io" "jit" "math" "os" "package" "self" "string" "table" "utf8")) + (#eq? @variable.builtin "self")) + +((identifier) @namespace.builtin + (#any-of? @namespace.builtin "_G" "debug" "io" "jit" "math" "os" "package" "string" "table" "utf8")) ((identifier) @keyword.coroutine (#eq? @keyword.coroutine "coroutine")) @@ -210,5 +216,7 @@ (string) @string @spell +(escape_sequence) @string.escape + ;; Error (ERROR) @error diff --git a/runtime/queries/lua/injections.scm b/runtime/queries/lua/injections.scm index 1c7bdaf951..3fcebe83f3 100644 --- a/runtime/queries/lua/injections.scm +++ b/runtime/queries/lua/injections.scm @@ -13,6 +13,14 @@ (#set! injection.language "vim") (#any-of? @_vimcmd_identifier "vim.cmd" "vim.api.nvim_command" "vim.api.nvim_exec2" "vim.api.nvim_cmd")) +; 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 content: _ @_method) . (string content: _ @injection.content))) + (#set! injection.language "lua") + (#any-of? @_vimcmd_identifier "vim.rpcrequest" "vim.rpcnotify") + (#eq? @_method "nvim_exec_lua")) + ((function_call name: (_) @_vimcmd_identifier arguments: (arguments (string content: _ @injection.content) .)) @@ -20,7 +28,7 @@ (#any-of? @_vimcmd_identifier "vim.treesitter.query.set" "vim.treesitter.query.parse")) ;; highlight string as query if starts with `;; query` -((string ("string_content") @injection.content) +(string content: _ @injection.content (#set! injection.language "query") (#lua-match? @injection.content "^%s*;+%s?query")) |