Skip to content

Commit

Permalink
Updated Swift grammar, adding 'any' and 'await' keywords. (helix-edit…
Browse files Browse the repository at this point in the history
  • Loading branch information
7ombie authored and mtoohey31 committed Jun 2, 2024
1 parent bf3db1b commit c76d4cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1730,7 +1730,7 @@ language-servers = [ "sourcekit-lsp" ]

[[grammar]]
name = "swift"
source = { git = "https://github.com/alex-pinkus/tree-sitter-swift", rev = "77c6312c8438f4dbaa0350cec92b3d6dd3d74a66" }
source = { git = "https://github.com/alex-pinkus/tree-sitter-swift", rev = "b1b66955d420d5cf5ff268ae552f0d6e43ff66e1" }

[[language]]
name = "erb"
Expand Down
6 changes: 4 additions & 2 deletions runtime/queries/swift/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
; Upstream: https://github.com/alex-pinkus/tree-sitter-swift/blob/8d2fd80e3322df51e3f70952e60d57f5d4077eb8/queries/highlights.scm
; Upstream: https://github.com/alex-pinkus/tree-sitter-swift/blob/1c586339fb00014b23d6933f2cc32b588a226f3b/queries/highlights.scm

(line_string_literal
["\\(" ")"] @punctuation.special)

["." ";" ":" "," ] @punctuation.delimiter
["(" ")" "[" "]" "{" "}"] @punctuation.bracket ; TODO: "\\(" ")" in interpolations should be @punctuation.special
["(" ")" "[" "]" "{" "}"] @punctuation.bracket

; Identifiers
(attribute) @variable
Expand All @@ -26,6 +26,7 @@
(function_declaration "init" @constructor)
(throws) @keyword
"async" @keyword
"await" @keyword
(where_keyword) @keyword
(parameter external_name: (simple_identifier) @variable.parameter)
(parameter name: (simple_identifier) @variable.parameter)
Expand All @@ -48,6 +49,7 @@
"convenience"
"required"
"some"
"any"
] @keyword

[
Expand Down

0 comments on commit c76d4cf

Please sign in to comment.