Skip to content

Commit

Permalink
feat: Categorize Rust's keywords using more specific scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
poliorcetics committed Oct 28, 2022
1 parent 26f21da commit ec5c6d3
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions runtime/queries/rust/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -111,23 +111,31 @@
; -------

(for_expression
"for" @keyword.control)
"for" @keyword.control.repeat)
((identifier) @keyword.control
(#match? @keyword.control "^yield$"))

"in" @keyword.control

[
"match"
"if"
"else"
] @keyword.control.conditional

[
"while"
"loop"
"in"
] @keyword.control.repeat

[
"break"
"continue"

"match"
"if"
"else"
"return"

"await"
] @keyword.control
] @keyword.control.return

"use" @keyword.control.import
(mod_item "mod" @keyword.control.import !body)
Expand All @@ -143,24 +151,28 @@
"mod"
"extern"

"struct"
"enum"
"impl"
"where"
"trait"
"for"

"type"
"union"
"unsafe"
"default"
"macro_rules!"

"let"

"async"
] @keyword

[
"struct"
"enum"
"union"

"type"
] @keyword.storage.type

"let" @keyword.local

"fn" @keyword.function

(mutable_specifier) @keyword.storage.modifier.mut
Expand Down

0 comments on commit ec5c6d3

Please sign in to comment.