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