mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 10:50:06 -04:00
Update teal queries
This commit is contained in:
parent
9cfcae6a9c
commit
47fae4eff8
3 changed files with 13 additions and 13 deletions
|
|
@ -7,6 +7,6 @@
|
||||||
(function_statement)
|
(function_statement)
|
||||||
(record_declaration)
|
(record_declaration)
|
||||||
(enum_declaration)
|
(enum_declaration)
|
||||||
(functiondef)
|
;(functiondef)
|
||||||
(table_constructor)
|
(table_constructor)
|
||||||
] @fold
|
] @fold
|
||||||
|
|
|
||||||
|
|
@ -32,25 +32,23 @@
|
||||||
|
|
||||||
[ "," "." ":"] @punctuation.delimiter
|
[ "," "." ":"] @punctuation.delimiter
|
||||||
[ "(" ")" "[" "]" "{" "}" ] @punctuation.bracket
|
[ "(" ")" "[" "]" "{" "}" ] @punctuation.bracket
|
||||||
("<" @punctuation.bracket
|
(typeargs ["<" ">"] @punctuation.bracket)
|
||||||
. (typearg) . ("," (typearg))* .
|
|
||||||
">" @punctuation.bracket)
|
|
||||||
|
|
||||||
(identifier) @variable
|
(identifier) @variable
|
||||||
(boolean) @boolean
|
(boolean) @boolean
|
||||||
(nil) @constant.builtin
|
(nil) @constant.builtin
|
||||||
(varargs) @constant
|
(varargs) @constant
|
||||||
|
|
||||||
; function stuffs
|
;; function stuffs;
|
||||||
(functiondef ["function" "end"] @keyword.function)
|
|
||||||
|
|
||||||
(function_statement [(function_name) (function_name (_))] @function)
|
(function_statement (function_name) @function)
|
||||||
(function_statement ["function" "end"] @keyword.function)
|
(function_statement ["function" "end"] @keyword.function)
|
||||||
|
|
||||||
(function_call
|
(function_call
|
||||||
(identifier) @function . (arguments))
|
(identifier) @function . (arguments))
|
||||||
|
|
||||||
(arg_name) @parameter
|
(arg
|
||||||
|
name: (identifier) @parameter)
|
||||||
|
|
||||||
; type stuffs
|
; type stuffs
|
||||||
(type_declaration "type" @keyword)
|
(type_declaration "type" @keyword)
|
||||||
|
|
@ -59,12 +57,12 @@
|
||||||
(function_type "function" @type)
|
(function_type "function" @type)
|
||||||
(record_name) @type
|
(record_name) @type
|
||||||
(enum_name) @type
|
(enum_name) @type
|
||||||
(typearg) @parameter
|
(typeargs (identifier) @parameter)
|
||||||
|
|
||||||
(table_constructor ["{" "}"] @constructor)
|
(table_constructor ["{" "}"] @constructor)
|
||||||
(comment) @comment
|
(comment) @comment
|
||||||
(string) @string
|
(string) @string
|
||||||
(number) @number
|
(number) @number
|
||||||
; TODO (label_statement) @label
|
;; TODO (label_statement) @label
|
||||||
|
|
||||||
(ERROR) @error
|
(ERROR) @error
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,13 @@
|
||||||
(var (identifier)) @definition.var)
|
(var (identifier)) @definition.var)
|
||||||
|
|
||||||
(var_assignment
|
(var_assignment
|
||||||
(var (identifier)) @definition.associated @definition.var)
|
(var (identifier)) @definition.var)
|
||||||
|
|
||||||
(arg_name) @definition.parameter
|
(arg
|
||||||
|
name: (identifier) @definition.parameter)
|
||||||
|
(typeargs (identifier) @definition.type)
|
||||||
|
|
||||||
(functiondef) @scope
|
;(functiondef) @scope
|
||||||
((function_statement
|
((function_statement
|
||||||
(function_name) @definition.function) @scope
|
(function_name) @definition.function) @scope
|
||||||
(#set! definition.function.scope "parent"))
|
(#set! definition.function.scope "parent"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue