[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rust-mode 758ab8c 303/486: Add support for "default" keywo
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rust-mode 758ab8c 303/486: Add support for "default" keyword |
Date: |
Sat, 7 Aug 2021 09:25:41 -0400 (EDT) |
branch: elpa/rust-mode
commit 758ab8c6aaa04802223db1eca8c1f7f76c13727d
Author: Tom Tromey <tom@tromey.com>
Commit: Tom Tromey <tom@tromey.com>
Add support for "default" keyword
Add context-sensitive fontification for the "default" keyword.
---
rust-mode-tests.el | 9 +++++++++
rust-mode.el | 2 ++
2 files changed, 11 insertions(+)
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 5abd4a7..6d58906 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -1510,6 +1510,15 @@ this_is_not_a_string();)"
;; Only the i32 should have been highlighted.
'("i32" font-lock-type-face)))
+(ert-deftest rust-test-default-context-sensitive ()
+ (rust-test-font-lock
+ "let default = 7; impl foo { default fn f() { } }"
+ '("let" font-lock-keyword-face
+ "impl" font-lock-keyword-face
+ "default" font-lock-keyword-face
+ "fn" font-lock-keyword-face
+ "f" font-lock-function-name-face)))
+
(ert-deftest indent-method-chains-no-align ()
(let ((rust-indent-method-chain nil)) (test-indent
"
diff --git a/rust-mode.el b/rust-mode.el
index f1c3994..9f9e391 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -526,6 +526,7 @@ buffer."
(defun rust-re-item-def-imenu (itype)
(concat "^[[:space:]]*"
(rust-re-shy (concat (rust-re-word rust-re-vis) "[[:space:]]+")) "?"
+ (rust-re-shy (concat (rust-re-word "default") "[[:space:]]+")) "?"
(rust-re-shy (concat (rust-re-word rust-re-unsafe) "[[:space:]]+"))
"?"
(rust-re-shy (concat (rust-re-word rust-re-extern) "[[:space:]]+"
(rust-re-shy "\"[^\"]+\"[[:space:]]+") "?")) "?"
@@ -555,6 +556,7 @@ the desired identifiers), but does not match type
annotations \"foo::<\"."
(append
`(
;; Keywords proper
+ ("\\_<\\(default\\)[[:space:]]+fn\\_>" 1 font-lock-keyword-face)
(,(regexp-opt rust-mode-keywords 'symbols) . font-lock-keyword-face)
;; Special types
- [nongnu] elpa/rust-mode 99c5571 190/486: Merge pull request #68 from tromey/fix-issue-53, (continued)
- [nongnu] elpa/rust-mode 99c5571 190/486: Merge pull request #68 from tromey/fix-issue-53, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 5f5a428 192/486: Merge pull request #88 from kw-udon/nested-comment, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 1ff1d75 193/486: Merge pull request #90 from Wilfred/fix_type_word_boundaries, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 30d1dac 198/486: Recognize compiler help and notes as "info" messages, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 61a35f6 202/486: Merge pull request #97 from syohex/update-url, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 0cf2bc3 255/486: Merge pull request #157 from fmdkdd/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode c2a0c13 269/486: Add info to enable rustfmt, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode cd09a54 280/486: Merge pull request #189 from froydnj/minor-cleanups, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 19e6f60 291/486: Merge pull request #199 from tromey/open-paren-in-column-0, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 7f7b2ac 293/486: mention keybinding for rustfmt, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 758ab8c 303/486: Add support for "default" keyword,
ELPA Syncer <=
- [nongnu] elpa/rust-mode a73e9ee 004/486: Update reserved words for syntax highlighters (vim is still behind, though), ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 7724813 306/486: Merge pull request #206 from cjhowe7/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode ac6a45e 308/486: Merge pull request #213 from KeenS/restore-points, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode d38bfb8 309/486: Set `compile-command' in `rust-mode'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode c00c8a9 312/486: Require `json'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 90f70ac 328/486: Use `font-lock-variable-name-face' for `let' bindings., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 9eda807 341/486: Merge pull request #239 from shepmaster/no-more-int-float, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 1275a19 363/486: make rustc-colon-compilation-regexps an info type, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 9154e0e 372/486: silence byte-compiler, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 5f37343 379/486: Add rust-indent-return-type-to-arguments variable, ELPA Syncer, 2021/08/07