[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rust-mode 74c2647 411/486: Highlight variable name in a fo
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rust-mode 74c2647 411/486: Highlight variable name in a for-loop (#326) |
Date: |
Sat, 7 Aug 2021 09:26:04 -0400 (EDT) |
branch: elpa/rust-mode
commit 74c264783e25166055a7871a00e4f68fe0495a0d
Author: Konstantin Kharlamov <Hi-Angel@users.noreply.github.com>
Commit: Nathan Moreau <nathan.moreau@m4x.org>
Highlight variable name in a for-loop (#326)
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
---
rust-mode-tests.el | 12 ++++++++++++
rust-mode.el | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 0c1ad1d..a22e43a 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -3118,6 +3118,18 @@ impl Two<'a> {
"b" font-lock-variable-name-face
"u32" font-lock-type-face)))
+(ert-deftest variable-in-for-loop ()
+ (rust-test-font-lock
+ "for var in iter"
+ '("for" font-lock-keyword-face
+ "var" font-lock-variable-name-face
+ "in" font-lock-keyword-face))
+ (rust-test-font-lock
+ "for Foo{var} in iter"
+ '("for" font-lock-keyword-face
+ "Foo" font-lock-type-face
+ "in" font-lock-keyword-face)))
+
(when (executable-find rust-cargo-bin)
(ert-deftest rust-test-project-located ()
(lexical-let* ((test-dir (expand-file-name "test-project"
default-directory))
diff --git a/rust-mode.el b/rust-mode.el
index cdc44e5..ec4f1c9 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -700,7 +700,7 @@ Returns nil if the point is not within a Rust string."
(,rust-re-type-or-constructor 1 font-lock-type-face)
;; Type-inferred binding
- (,(concat "\\_<\\(?:let\\s-+ref\\|let\\|ref\\)\\s-+\\(?:mut\\s-+\\)?"
(rust-re-grab rust-re-ident) "\\_>") 1 font-lock-variable-name-face)
+ (,(concat
"\\_<\\(?:let\\s-+ref\\|let\\|ref\\|for\\)\\s-+\\(?:mut\\s-+\\)?" (rust-re-grab
rust-re-ident) "\\_>") 1 font-lock-variable-name-face)
;; Type names like `Foo::`, highlight excluding the ::
(,(rust-path-font-lock-matcher rust-re-uc-ident) 1 font-lock-type-face)
- [nongnu] elpa/rust-mode 63deaf3 382/486: Remove old comment, (continued)
- [nongnu] elpa/rust-mode 63deaf3 382/486: Remove old comment, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 55e6cd9 392/486: Add test for word boundaries for string ending with r., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode e53dc8a 394/486: Don't call syntax-ppss twice for raw strings., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode fe02536 395/486: Add `await` to list of keywords, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode c62185a 397/486: Merge pull request #304 from kurnevsky/raw-string-propertize, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 295e234 404/486: rust-compile, rust-run, rust-test: respect rust-cargo-bin. (#321), ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 5aeae14 407/486: rust-format-diff-buffer: use start-process rather than make-process., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 86b82ad 408/486: rust-format-diff-buffer-sentinel: use diff-mode and pop-to-buffer., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 836a8a9 409/486: Don't set indent-tabs-mode. (#324), ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 897af24 410/486: rust-mode.el: check for possible space between variable name and type (#325), ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 74c2647 411/486: Highlight variable name in a for-loop (#326),
ELPA Syncer <=
- [nongnu] elpa/rust-mode bb9bbd2 413/486: readme: recommend setting indent-tabs-mode to nil, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 6dca073 414/486: readme: make other useful packages a list, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 7960c74 417/486: Do not allow subword-match when detecting built-in formatting macros, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 5ad9b59 418/486: subword-match for built-in formatting macros: add a test., ELPA Syncer, 2021/08/07
- [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