diff options
| author | Yuan Fu | 2024-07-06 14:07:39 -0700 |
|---|---|---|
| committer | Yuan Fu | 2024-07-06 14:08:26 -0700 |
| commit | 2e9777512a0cd2fb2e60706d6908247496faeeec (patch) | |
| tree | d1c3da88e64590dc464c3ee8050d12d0c4cb3b26 | |
| parent | d826240fa56230ef1561d5b4807284ce98a8c6b6 (diff) | |
| download | emacs-2e9777512a0cd2fb2e60706d6908247496faeeec.tar.gz emacs-2e9777512a0cd2fb2e60706d6908247496faeeec.zip | |
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.
| -rw-r--r-- | lisp/progmodes/rust-ts-mode.el | 6 |
1 files changed, 5 insertions, 1 deletions
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." | |||
| 267 | eos) | 267 | eos) |
| 268 | @font-lock-type-face)) | 268 | @font-lock-type-face)) |
| 269 | ((scoped_identifier path: (identifier) @rust-ts-mode--fontify-scope)) | 269 | ((scoped_identifier path: (identifier) @rust-ts-mode--fontify-scope)) |
| 270 | ((scoped_type_identifier path: (identifier) @rust-ts-mode--fontify-scope))) | 270 | ((scoped_type_identifier path: (identifier) @rust-ts-mode--fontify-scope)) |
| 271 | ;; Sometimes the parser can't determine if an identifier is a type, | ||
| 272 | ;; so we use this heuristic. See bug#69625 for the full discussion. | ||
| 273 | ((identifier) @font-lock-type-face | ||
| 274 | (:match ,(rx bos upper) @font-lock-type-face))) | ||
| 271 | 275 | ||
| 272 | :language 'rust | 276 | :language 'rust |
| 273 | :feature 'property | 277 | :feature 'property |