Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--runtime/queries/swift/highlights.scm9
-rw-r--r--runtime/queries/swift/injections.scm4
2 files changed, 11 insertions, 2 deletions
diff --git a/runtime/queries/swift/highlights.scm b/runtime/queries/swift/highlights.scm
index 42411d90..df05a643 100644
--- a/runtime/queries/swift/highlights.scm
+++ b/runtime/queries/swift/highlights.scm
@@ -4,7 +4,7 @@
["\\(" ")"] @punctuation.special)
["." ";" ":" "," ] @punctuation.delimiter
-["(" ")" "[" "]" "{" "}"] @punctuation.bracket
+["(" ")" "[" "]" "{" "}" "<" ">"] @punctuation.bracket
; Identifiers
(attribute) @variable
@@ -24,6 +24,7 @@
] @keyword
(function_declaration (simple_identifier) @function.method)
+(protocol_function_declaration (simple_identifier) @function.method)
(init_declaration ["init" @constructor])
(deinit_declaration ["deinit" @constructor])
@@ -91,6 +92,9 @@
(#match? @type "^[A-Z]"))
(call_expression (simple_identifier) @keyword (#eq? @keyword "defer")) ; defer { ... }
+(navigation_suffix
+ (simple_identifier) @variable.other.member)
+
(try_operator) @operator
(try_operator ["try" @keyword])
@@ -147,7 +151,7 @@
(integer_literal) @constant.numeric.integer
(real_literal) @constant.numeric.float
(boolean_literal) @constant.builtin.boolean
-"nil" @variable.builtin
+"nil" @constant.builtin
"?" @type
(type_annotation "!" @type)
@@ -160,6 +164,7 @@
"?"
"+"
"-"
+ "\\"
"*"
"/"
"%"
diff --git a/runtime/queries/swift/injections.scm b/runtime/queries/swift/injections.scm
index 0ac6cddf..fb78129a 100644
--- a/runtime/queries/swift/injections.scm
+++ b/runtime/queries/swift/injections.scm
@@ -4,3 +4,7 @@
((regex_literal) @injection.content
(#set! injection.language "regex"))
+
+((comment) @injection.content
+ (#set! injection.language "comment")
+ (#set! injection.include-children))