mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
Update teal highlights
This commit is contained in:
parent
740ff78a97
commit
fb20cf868b
4 changed files with 27 additions and 26 deletions
|
|
@ -1,6 +1,7 @@
|
|||
[
|
||||
(do_statement)
|
||||
(for_statement)
|
||||
(numeric_for_statement)
|
||||
(generic_for_statement)
|
||||
(while_statement)
|
||||
(repeat_statement)
|
||||
(if_statement)
|
||||
|
|
@ -10,7 +11,3 @@
|
|||
(anon_function)
|
||||
(table_constructor)
|
||||
] @fold
|
||||
|
||||
(record_body
|
||||
(record_entry
|
||||
value: (record_body)) @fold)
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
;; Basic statements/Keywords
|
||||
[ "if" "then" "elseif" "else" ] @conditional
|
||||
[ "for" "while" "repeat" "until" ] @repeat
|
||||
[ "in" "local" (break) (goto) "do" "end" ] @keyword
|
||||
"return" @keyword.return
|
||||
[ "in" "local" (break) (goto) "do" "end" ] @keyword
|
||||
(label) @label
|
||||
|
||||
;; Global isn't a real keyword, but it gets special treatment in these places
|
||||
|
|
@ -69,13 +69,17 @@
|
|||
name: (identifier) @type)
|
||||
(anon_record . "record" @keyword)
|
||||
(record_body
|
||||
(record_entry
|
||||
. [ "record" "enum" ] @keyword
|
||||
. key: (identifier) @type))
|
||||
(record_declaration
|
||||
. [ "record" ] @keyword
|
||||
. name: (identifier) @type))
|
||||
(record_body
|
||||
(record_entry
|
||||
(enum_declaration
|
||||
. [ "enum" ] @keyword
|
||||
. name: (identifier) @type))
|
||||
(record_body
|
||||
(typedef
|
||||
. "type" @keyword
|
||||
. key: (identifier) @type . "="))
|
||||
. name: (identifier) @type . "="))
|
||||
(record_body
|
||||
(metamethod "metamethod" @keyword))
|
||||
(record_body
|
||||
|
|
@ -86,7 +90,7 @@
|
|||
name: (identifier) @type)
|
||||
|
||||
(type_declaration "type" @keyword)
|
||||
(type_declaration (type_name) @type)
|
||||
(type_declaration (identifier) @type)
|
||||
(simple_type) @type
|
||||
(type_index) @type
|
||||
(type_union "|" @operator)
|
||||
|
|
@ -94,12 +98,14 @@
|
|||
|
||||
;; The rest of it
|
||||
(var_declaration
|
||||
(var name: (identifier) @variable))
|
||||
declarators: (var_declarators
|
||||
(var name: (identifier) @variable)))
|
||||
(var_declaration
|
||||
(var
|
||||
"<" @punctuation.bracket
|
||||
. attribute: (attribute) @attribute
|
||||
. ">" @punctuation.bracket))
|
||||
declarators: (var_declarators
|
||||
(var
|
||||
"<" @punctuation.bracket
|
||||
. attribute: (attribute) @attribute
|
||||
. ">" @punctuation.bracket)))
|
||||
[ "(" ")" "[" "]" "{" "}" ] @punctuation.bracket
|
||||
|
||||
;; Only highlight format specifiers in calls to string.format
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
[
|
||||
(record_declaration)
|
||||
(record_entry)
|
||||
(anon_function)
|
||||
(function_body)
|
||||
(table_constructor)
|
||||
(if_statement)
|
||||
(for_statement)
|
||||
(return_statement)
|
||||
(while_statement)
|
||||
] @indent
|
||||
|
|
|
|||
|
|
@ -1,23 +1,23 @@
|
|||
|
||||
(var_declaration
|
||||
(var (identifier)) @definition.var)
|
||||
declarators: (var_declarators
|
||||
(var (identifier)) @definition.var))
|
||||
|
||||
(var_assignment
|
||||
(var (identifier) @definition.var) @definition.associated)
|
||||
variables: (assignment_variables
|
||||
(var (identifier) @definition.var) @definition.associated))
|
||||
|
||||
(arg name: (identifier) @definition.parameter)
|
||||
|
||||
(anon_function) @scope
|
||||
((function_statement
|
||||
(function_name) @definition.function) @scope
|
||||
(#set! definition.function.scope "parent"))
|
||||
(function_name) @definition.function) @scope)
|
||||
|
||||
(program) @scope
|
||||
(if_statement) @scope
|
||||
(for_statement (for_body) @scope)
|
||||
(generic_for_statement (for_body) @scope)
|
||||
(numeric_for_statement (for_body) @scope)
|
||||
(repeat_statement) @scope
|
||||
(while_statement (while_body) @scope)
|
||||
(do_statement) @scope
|
||||
|
||||
(identifier) @reference
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue