aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2022-11-22 21:25:51 +0100
committerGitHub <noreply@github.com>2022-11-22 21:25:51 +0100
commit915891f28c3bd51007ea4105db82c62c17177115 (patch)
treee030dcd7158f72d36e9a97f11ba9c2180603051d
parentcd386b2c72eaacd9acac27380ee34db1accad9cb (diff)
downloadrneovim-915891f28c3bd51007ea4105db82c62c17177115.tar.gz
rneovim-915891f28c3bd51007ea4105db82c62c17177115.tar.bz2
rneovim-915891f28c3bd51007ea4105db82c62c17177115.zip
build(deps): update viml parser and queries (#21158)
-rw-r--r--cmake.deps/CMakeLists.txt4
-rw-r--r--runtime/queries/vim/highlights.scm37
-rw-r--r--runtime/queries/vim/injections.scm14
3 files changed, 44 insertions, 11 deletions
diff --git a/cmake.deps/CMakeLists.txt b/cmake.deps/CMakeLists.txt
index 62c38e2a2f..9c92d1a71c 100644
--- a/cmake.deps/CMakeLists.txt
+++ b/cmake.deps/CMakeLists.txt
@@ -200,8 +200,8 @@ set(TREESITTER_C_SHA256 af66fde03feb0df4faf03750102a0d265b007e5d957057b6b293c131
set(TREESITTER_LUA_URL https://github.com/MunifTanjim/tree-sitter-lua/archive/v0.0.14.tar.gz)
set(TREESITTER_LUA_SHA256 930d0370dc15b66389869355c8e14305b9ba7aafd36edbfdb468c8023395016d)
-set(TREESITTER_VIM_URL https://github.com/vigoux/tree-sitter-viml/archive/v0.2.0.tar.gz)
-set(TREESITTER_VIM_SHA256 608dcc31a7948cb66ae7f45494620e2e9face1af75598205541f80d782ec4501)
+set(TREESITTER_VIM_URL https://github.com/vigoux/tree-sitter-viml/archive/55ff1b080c09edeced9b748cf4c16d0b49d17fb9.tar.gz)
+set(TREESITTER_VIM_SHA256 1b1cd39e33c8fb02fa7fe3977e844883c2a8508a7edd621f2d21e39a9aeefa92)
set(TREESITTER_HELP_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v1.2.5.tar.gz)
set(TREESITTER_HELP_SHA256 379d764937a0e3a38e3f9ce9a62c93ba24211a236c74181dd04ee3b4631472a8)
diff --git a/runtime/queries/vim/highlights.scm b/runtime/queries/vim/highlights.scm
index 3d1729b2cd..239b0a0b37 100644
--- a/runtime/queries/vim/highlights.scm
+++ b/runtime/queries/vim/highlights.scm
@@ -36,7 +36,8 @@
;; Function related
(function_declaration name: (_) @function)
-(call_expression function: (identifier) @function)
+(call_expression function: (identifier) @function.call)
+(call_expression function: (scoped_identifier (identifier) @function.call))
(parameters (identifier) @parameter)
(default_parameter (identifier) @parameter)
@@ -59,14 +60,20 @@
"execute"
"normal"
"set"
+ "setfiletype"
"setlocal"
"silent"
"echo"
+ "echon"
+ "echohl"
"echomsg"
+ "echoerr"
"autocmd"
"augroup"
"return"
"syntax"
+ "filetype"
+ "source"
"lua"
"ruby"
"perl"
@@ -98,10 +105,21 @@
"ex"
"visual"
"view"
+ "eval"
] @keyword
(map_statement cmd: _ @keyword)
(command_name) @function.macro
+;; Filetype command
+
+(filetype_statement [
+ "detect"
+ "plugin"
+ "indent"
+ "on"
+ "off"
+] @keyword)
+
;; Syntax command
(syntax_statement (keyword) @string)
@@ -118,6 +136,8 @@
"match"
"cluster"
"region"
+ "clear"
+ "include"
] @keyword)
(syntax_argument name: _ @keyword)
@@ -175,15 +195,18 @@
;; Literals
-(string_literal) @string @spell
+(string_literal) @string
(integer_literal) @number
(float_literal) @float
(comment) @comment @spell
+(line_continuation_comment) @comment @spell
(pattern) @string.special
(pattern_multi) @string.regex
(filename) @string
(heredoc (body) @string)
-((heredoc (parameter) @keyword))
+(heredoc (parameter) @keyword)
+[ (marker_definition) (endmarker) ] @label
+(literal_dictionary (literal_key) @label)
((scoped_identifier
(scope) @_scope . (identifier) @boolean)
(#eq? @_scope "v:")
@@ -219,12 +242,16 @@
"%="
".="
"..="
+ "<<"
+ "=<<"
+ (match_case)
] @operator
; Some characters have different meanings based on the context
(unary_operation "!" @operator)
(binary_operation "." @operator)
+
;; Punctuation
[
@@ -234,6 +261,7 @@
"}"
"["
"]"
+ "#{"
] @punctuation.bracket
(field_expression "." @punctuation.delimiter)
@@ -249,6 +277,9 @@
((set_value) @number
(#match? @number "^[0-9]+(\.[0-9]+)?$"))
+(inv_option "!" @operator)
+(set_item "?" @operator)
+
((set_item
option: (option_name) @_option
value: (set_value) @function)
diff --git a/runtime/queries/vim/injections.scm b/runtime/queries/vim/injections.scm
index e2dea8fe75..fdd025bfd9 100644
--- a/runtime/queries/vim/injections.scm
+++ b/runtime/queries/vim/injections.scm
@@ -1,13 +1,14 @@
(lua_statement (script (body) @lua))
(lua_statement (chunk) @lua)
-; (ruby_statement (script (body) @ruby))
-; (ruby_statement (chunk) @ruby)
-; (python_statement (script (body) @python))
-; (python_statement (chunk) @python)
+(ruby_statement (script (body) @ruby))
+(ruby_statement (chunk) @ruby)
+(python_statement (script (body) @python))
+(python_statement (chunk) @python)
+;; If we support perl at some point...
;; (perl_statement (script (body) @perl))
;; (perl_statement (chunk) @perl)
-; (autocmd_statement (pattern) @regex)
+(autocmd_statement (pattern) @regex)
((set_item
option: (option_name) @_option
@@ -23,4 +24,5 @@
"patchexpr" "pex"
"charconvert" "ccv"))
-; (comment) @comment
+(comment) @comment
+(line_continuation_comment) @comment