diff --git a/queries/swift/highlights.scm b/queries/swift/highlights.scm index d744669c0..e30618c74 100644 --- a/queries/swift/highlights.scm +++ b/queries/swift/highlights.scm @@ -1,3 +1,6 @@ +[ "." ";" ":" "," "->" ] @punctuation.delimiter +[ "\\(" "(" ")" "[" "]" "{" "}"] @punctuation.bracket ; TODO: "\\(" ")" in interpolations should be @punctuation.special + ; Identifiers (attribute) @variable (simple_identifier) @variable diff --git a/tests/query/highlights/swift/string-interpolation.swift b/tests/query/highlights/swift/string-interpolation.swift new file mode 100644 index 000000000..d500d7cfa --- /dev/null +++ b/tests/query/highlights/swift/string-interpolation.swift @@ -0,0 +1,7 @@ +var one = 1 +var two = 2 +var name = "Let's do some math: \(one) + \(one) = \(one + one) = \(two)" +// ^ punctuation.bracket +// ^ variable +// ^ punctuation.bracket +// ^ punctuation.bracket