diff --git a/cmake.deps/CMakeLists.txt b/cmake.deps/CMakeLists.txt index 5917c776cf..4ff52f021f 100644 --- a/cmake.deps/CMakeLists.txt +++ b/cmake.deps/CMakeLists.txt @@ -187,8 +187,8 @@ set(LIBICONV_SHA256 ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc891 set(TREESITTER_C_URL https://github.com/tree-sitter/tree-sitter-c/archive/v0.20.5.tar.gz) set(TREESITTER_C_SHA256 694a5408246ee45d535df9df025febecdb50bee764df64a94346b9805a5f349b ) -set(TREESITTER_LUA_URL https://github.com/MunifTanjim/tree-sitter-lua/archive/v0.0.17.tar.gz) -set(TREESITTER_LUA_SHA256 8963fd0a185d786c164dfca3824941c7eaec497ce49a3a0bc24bf753f5e0e59c) +set(TREESITTER_LUA_URL https://github.com/MunifTanjim/tree-sitter-lua/archive/v0.0.18.tar.gz) +set(TREESITTER_LUA_SHA256 659beef871a7fa1d9a02c23f5ebf55019aa3adce6d7f5441947781e128845256) set(TREESITTER_VIM_URL https://github.com/neovim/tree-sitter-vim/archive/v0.3.0.tar.gz) set(TREESITTER_VIM_SHA256 403acec3efb7cdb18ff3d68640fc823502a4ffcdfbb71cec3f98aa786c21cbe2) set(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 537a171441..7608da57ad 100644 --- a/runtime/queries/lua/highlights.scm +++ b/runtime/queries/lua/highlights.scm @@ -180,13 +180,40 @@ (parameters (identifier) @parameter) -(function_call name: (identifier) @function.call) -(function_declaration name: (identifier) @function) +(function_declaration + name: [ + (identifier) @function + (dot_index_expression + field: (identifier) @function) + ]) -(function_call name: (dot_index_expression field: (identifier) @function.call)) -(function_declaration name: (dot_index_expression field: (identifier) @function)) +(function_declaration + name: (method_index_expression + method: (identifier) @method)) -(method_index_expression method: (identifier) @method.call) +(assignment_statement + (variable_list . + name: [ + (identifier) @function + (dot_index_expression + field: (identifier) @function) + ]) + (expression_list . + value: (function_definition))) + +(table_constructor + (field + name: (identifier) @function + value: (function_definition))) + +(function_call + name: [ + (identifier) @function.call + (dot_index_expression + field: (identifier) @function.call) + (method_index_expression + method: (identifier) @method.call) + ]) (function_call (identifier) @function.builtin @@ -214,7 +241,7 @@ (number) @number -(string) @string @spell +(string) @string (escape_sequence) @string.escape