File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -1317,6 +1317,15 @@ list of substrings of `STR' each followed by its face."
1317
1317
" mut" font-lock-keyword-face
1318
1318
" bar" font-lock-variable-name-face )))
1319
1319
1320
+ (ert-deftest font-lock-if-let-binding ()
1321
+ (rust-test-font-lock
1322
+ " if let Some(var) = some_var { /* no-op */ }"
1323
+ '(" if" font-lock-keyword-face
1324
+ " let" font-lock-keyword-face
1325
+ " Some" font-lock-type-face
1326
+ " /* " font-lock-comment-delimiter-face
1327
+ " no-op */" font-lock-comment-face )))
1328
+
1320
1329
(ert-deftest font-lock-single-quote-character-literal ()
1321
1330
(rust-test-font-lock
1322
1331
" fn main() { let ch = '\\ ''; }"
Original file line number Diff line number Diff line change @@ -682,6 +682,9 @@ match data if found. Returns nil if not within a Rust string."
682
682
; ; Field names like `foo:`, highlight excluding the :
683
683
(,(concat (rust-re-grab rust-re-ident) " :[^:]" ) 1 font-lock-variable-name-face )
684
684
685
+ ; ; CamelCase Means Type Or Constructor
686
+ (, rust-re-type-or-constructor 1 font-lock-type-face )
687
+
685
688
; ; Type-inferred binding
686
689
(,(concat " \\ _<\\ (?:let\\ |ref\\ )\\ s-+\\ (?:mut\\ s-+\\ )?" (rust-re-grab rust-re-ident) " \\ _>" ) 1 font-lock-variable-name-face )
687
690
@@ -694,9 +697,6 @@ match data if found. Returns nil if not within a Rust string."
694
697
; ; Lifetimes like `'foo`
695
698
(,(concat " '" (rust-re-grab rust-re-ident) " [^']" ) 1 font-lock-variable-name-face )
696
699
697
- ; ; CamelCase Means Type Or Constructor
698
- (, rust-re-type-or-constructor 1 font-lock-type-face )
699
-
700
700
; ; Question mark operator
701
701
(" \\ ?" . 'rust-question-mark-face )
702
702
)
You can’t perform that action at this time.
0 commit comments