Skip to content

Commit feb294c

Browse files
committed
auto merge of #14818 : tomjakubowski/rust/emacs-attributes-key-value, r=pnkfelix
This addresses two problems noted in #14347: the highlight of `#foo]` as an attribute, and the non-highlight of `#[foo = "bar"]`.
2 parents 9f8d220 + e5baf1d commit feb294c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/etc/emacs/rust-mode.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@
212212
;; Special types
213213
(,(regexp-opt rust-special-types 'words) . font-lock-type-face)
214214

215-
;; Attributes like `#[bar(baz)]` or `#![bar(baz)]`
216-
(,(rust-re-grab (concat "#\\!?[" rust-re-ident "[^]]*\\]"))
217-
1 font-lock-preprocessor-face)
215+
;; Attributes like `#[bar(baz)]` or `#![bar(baz)]` or `#[bar = "baz"]`
216+
(,(rust-re-grab (concat "#\\!?\\[" rust-re-ident "[^]]*\\]"))
217+
1 font-lock-preprocessor-face t)
218218

219219
;; Syntax extension invocations like `foo!`, highlight including the !
220220
(,(concat (rust-re-grab (concat rust-re-ident "!")) "[({[:space:][]")

0 commit comments

Comments
 (0)