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.
This commit is contained in:
Yuan Fu 2024-07-06 14:07:39 -07:00
parent d826240fa5
commit 2e9777512a
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View file

@ -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