From 00991da66dee3cb7a309563eb13451f528c57289 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Sat, 6 Jul 2024 14:07:39 -0700 Subject: [PATCH] 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) --- lisp/progmodes/rust-ts-mode.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.39.2