mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 03:26:52 -04:00
highlights(swift): add more @operators and implicit keyword
This commit is contained in:
parent
8025b90329
commit
cc1890528f
2 changed files with 25 additions and 1 deletions
|
|
@ -29,7 +29,15 @@
|
|||
(inheritance_constraint (identifier (simple_identifier) @parameter))
|
||||
(equality_constraint (identifier (simple_identifier) @parameter))
|
||||
|
||||
["typealias" "struct" "class" "enum" "protocol" "extension"] @keyword
|
||||
[
|
||||
"typealias"
|
||||
"struct"
|
||||
"class"
|
||||
"enum"
|
||||
"protocol"
|
||||
"extension"
|
||||
"indirect"
|
||||
] @keyword
|
||||
|
||||
(class_body (property_declaration (value_binding_pattern (non_binding_pattern (simple_identifier) @property))))
|
||||
(protocol_property_declaration (value_binding_pattern (non_binding_pattern (simple_identifier) @property)))
|
||||
|
|
@ -69,6 +77,8 @@
|
|||
(switch_entry ["fallthrough" @keyword])
|
||||
(switch_entry (default_keyword) @keyword)
|
||||
"return" @keyword.return
|
||||
(ternary_expression
|
||||
["?" ":"] @conditional)
|
||||
|
||||
["do" (throw_keyword) (catch_keyword)] @keyword
|
||||
|
||||
|
|
@ -129,6 +139,12 @@
|
|||
"%="
|
||||
"!="
|
||||
"!=="
|
||||
"=="
|
||||
"==="
|
||||
"??"
|
||||
|
||||
"->"
|
||||
|
||||
"..<"
|
||||
"..."
|
||||
] @operator
|
||||
|
|
|
|||
8
tests/query/highlights/swift/range-expressions.swift
Normal file
8
tests/query/highlights/swift/range-expressions.swift
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
for i in 0..<5 {
|
||||
// ^ operator
|
||||
print(i)
|
||||
}
|
||||
for i in 0...5 {
|
||||
// ^ operator
|
||||
print(i)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue