Skip to content

Commit

Permalink
Improve Rust syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
chbk committed Feb 21, 2025
1 parent dff47a8 commit fd3d1b0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/languages/src/rust/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
(identifier) @variable
(type_identifier) @type
(primitive_type) @type.builtin
(self) @variable.special
Expand Down Expand Up @@ -47,8 +48,8 @@
(#match? @type "^[A-Z]"))

; Assume all-caps names are constants
((identifier) @constant
(#match? @constant "^_*[A-Z][A-Z\\d_]*$"))
((identifier) @constant.variable
(#match? @constant.variable "^_*[A-Z][A-Z\\d_]*$"))

[
"("
Expand Down Expand Up @@ -129,7 +130,7 @@
(float_literal)
] @number

(boolean_literal) @constant
(boolean_literal) @boolean

[
(line_comment)
Expand Down

0 comments on commit fd3d1b0

Please sign in to comment.