Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions crates/languages/src/rust/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
(self) @variable.special
(field_identifier) @property

(shorthand_field_initializer
(identifier) @property)

(trait_item name: (type_identifier) @type.interface)
(impl_item trait: (type_identifier) @type.interface)
(abstract_type trait: (type_identifier) @type.interface)
Expand Down Expand Up @@ -38,11 +41,20 @@
(identifier) @function.special
(scoped_identifier
name: (identifier) @function.special)
])
]
"!" @function.special)

(macro_definition
name: (identifier) @function.special.definition)

(mod_item
name: (identifier) @module)

(visibility_modifier [
(crate) @keyword
(super) @keyword
])

; Identifier conventions

; Assume uppercase names are types/enum-constructors
Expand Down Expand Up @@ -115,9 +127,7 @@
"where"
"while"
"yield"
(crate)
(mutable_specifier)
(super)
] @keyword

[
Expand Down Expand Up @@ -189,6 +199,7 @@
operator: "/" @operator

(lifetime) @lifetime
(lifetime (identifier) @lifetime)

(parameter (identifier) @variable.parameter)

Expand Down
Loading