From: Yuan Fu Date: Sat, 6 Jul 2024 21:07:39 +0000 (-0700) Subject: Add a heuristic for type font-lock in rust-ts-mode (bug#69625) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=00991da66dee3cb7a309563eb13451f528c57289;p=emacs.git Add a heuristic for type font-lock in rust-ts-mode (bug#69625) * lisp/progmodes/rust-ts-mode.el: (rust-ts-mode--font-lock-settings): Add rule. (cherry picked from commit 2e9777512a0cd2fb2e60706d6908247496faeeec) --- diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index baf0e1ec013..cdbf381d023 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el @@ -267,7 +267,11 @@ to be checked as its standard input." eos) @font-lock-type-face)) ((scoped_identifier path: (identifier) @rust-ts-mode--fontify-scope)) - ((scoped_type_identifier path: (identifier) @rust-ts-mode--fontify-scope))) + ((scoped_type_identifier path: (identifier) @rust-ts-mode--fontify-scope)) + ;; Sometimes the parser can't determine if an identifier is a type, + ;; so we use this heuristic. See bug#69625 for the full discussion. + ((identifier) @font-lock-type-face + (:match ,(rx bos upper) @font-lock-type-face))) :language 'rust :feature 'property