[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rust-mode 7ff04a8 337/486: Merge pull request #234 from jj
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rust-mode 7ff04a8 337/486: Merge pull request #234 from jjwest/master |
Date: |
Sat, 7 Aug 2021 09:25:48 -0400 (EDT) |
branch: elpa/rust-mode
commit 7ff04a8d26104c2e2c0737e219b320ecaeaafd9d
Merge: f57a8eb 6550d94
Author: Tom Tromey <tom@tromey.com>
Commit: GitHub <noreply@github.com>
Merge pull request #234 from jjwest/master
Types get correct font-lock in if-let statements
---
rust-mode-tests.el | 9 +++++++++
rust-mode.el | 6 +++---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index aab82df..f0a73a2 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -1317,6 +1317,15 @@ list of substrings of `STR' each followed by its face."
"mut" font-lock-keyword-face
"bar" font-lock-variable-name-face)))
+(ert-deftest font-lock-if-let-binding ()
+ (rust-test-font-lock
+ "if let Some(var) = some_var { /* no-op */ }"
+ '("if" font-lock-keyword-face
+ "let" font-lock-keyword-face
+ "Some" font-lock-type-face
+ "/* " font-lock-comment-delimiter-face
+ "no-op */" font-lock-comment-face)))
+
(ert-deftest font-lock-single-quote-character-literal ()
(rust-test-font-lock
"fn main() { let ch = '\\''; }"
diff --git a/rust-mode.el b/rust-mode.el
index 97b5c3c..72109e5 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -682,6 +682,9 @@ match data if found. Returns nil if not within a Rust
string."
;; Field names like `foo:`, highlight excluding the :
(,(concat (rust-re-grab rust-re-ident) ":[^:]") 1
font-lock-variable-name-face)
+ ;; CamelCase Means Type Or Constructor
+ (,rust-re-type-or-constructor 1 font-lock-type-face)
+
;; Type-inferred binding
(,(concat "\\_<\\(?:let\\|ref\\)\\s-+\\(?:mut\\s-+\\)?" (rust-re-grab
rust-re-ident) "\\_>") 1 font-lock-variable-name-face)
@@ -694,9 +697,6 @@ match data if found. Returns nil if not within a Rust
string."
;; Lifetimes like `'foo`
(,(concat "'" (rust-re-grab rust-re-ident) "[^']") 1
font-lock-variable-name-face)
- ;; CamelCase Means Type Or Constructor
- (,rust-re-type-or-constructor 1 font-lock-type-face)
-
;; Question mark operator
("\\?" . 'rust-question-mark-face)
)
- [nongnu] elpa/rust-mode 484d675 419/486: Adding GitHub actions., (continued)
- [nongnu] elpa/rust-mode 484d675 419/486: Adding GitHub actions., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode c5ab165 423/486: mention LSP support, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode a36bc70 426/486: Merge pull request #340 from brotzeit/readme, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 6a57253 427/486: rust-dbg-wrap-or-unwrap: bind to C-c C-d rather than C-c d., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode e8345f6 440/486: Add triagebot configuration (#364), ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode a364b24 445/486: Make *rustfmt* buffer readonly., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 15a077a 458/486: rustc-colon-compilation-regexps: improve highlighting., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 00177f5 461/486: compile-mode integration: add link to code references. (#391), ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 5585cf9 477/486: rust-mode: Cosmetics, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 3fa8f0b 479/486: Add non-empty commentary section, slightly reword summary, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 7ff04a8 337/486: Merge pull request #234 from jjwest/master,
ELPA Syncer <=
- [nongnu] elpa/rust-mode 70ff9a0 421/486: electric-pair-mode: prevent self-insert of `>' when already inserted. (#337), ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 4fd637c 428/486: rust-insert-dbg: handle the case of string literals. (#342), ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 844bb51 429/486: add support for "async fn", ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 63ec74c 434/486: Enforce use of spaces for indentation and cleanup whitespace (#353), ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode a36c96a 435/486: integrate rustfmt error messages, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 8665005 436/486: Introduce constant for *rustfmt*., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 08d7141 449/486: README: support for emacs 24 has been dropped., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 1603a25 455/486: Change 'rust-build' to 'rust-compile' in README.md, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 6e4835c 456/486: Update README.md, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 5dc219f 465/486: rearrange III: Mode, ELPA Syncer, 2021/08/07