Skip to content

Commit 6093d38

Browse files
nordlowAankhen
authored andcommitted
Add syntax coloring for type-inferred constants and variables
1 parent b10ad41 commit 6093d38

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rust-mode.el

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,12 @@ match data if found. Returns nil if not within a Rust string."
681681
;; Field names like `foo:`, highlight excluding the :
682682
(,(concat (rust-re-grab rust-re-ident) ":[^:]") 1 font-lock-variable-name-face)
683683

684+
;; Type-inferred constant
685+
(,(concat "\\_<\\(?:let\\|ref\\)\\s-+" (rust-re-grab rust-re-ident) "\\_>") 1 font-lock-constant-face)
686+
687+
;; Type-inferred variable
688+
(,(concat "\\_<\\(?:let\\|ref\\)\\s-+mut\\s-+" (rust-re-grab rust-re-ident) "\\_>") 1 font-lock-variable-name-face)
689+
684690
;; Type names like `Foo::`, highlight excluding the ::
685691
(,(rust-path-font-lock-matcher rust-re-uc-ident) 1 font-lock-type-face)
686692

0 commit comments

Comments
 (0)