[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 2661c51953 2/3: Improve fontification in typescript-ts-mode
From: |
Yuan Fu |
Subject: |
emacs-29 2661c51953 2/3: Improve fontification in typescript-ts-mode |
Date: |
Mon, 28 Nov 2022 18:10:06 -0500 (EST) |
branch: emacs-29
commit 2661c51953c3255d4e9ba014442ed78a546fd815
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Yuan Fu <casouri@gmail.com>
Improve fontification in typescript-ts-mode
- Restore method-name fontification.
- Fontify all types in class-declarations, extendees too
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings): Change patterns.
---
lisp/progmodes/typescript-ts-mode.el | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/lisp/progmodes/typescript-ts-mode.el
b/lisp/progmodes/typescript-ts-mode.el
index bf483a31d3..6c926a4e3e 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -150,12 +150,20 @@
(method_definition
name: (property_identifier) @font-lock-function-name-face)
+ (required_parameter (identifier) @font-lock-variable-name-face)
+ (optional_parameter (identifier) @font-lock-variable-name-face)
(variable_declarator
name: (identifier) @font-lock-variable-name-face)
(enum_declaration (identifier) @font-lock-type-face)
+ (extends_clause value: (identifier) @font-lock-type-face)
+ ;; extends React.Component<T>
+ (extends_clause value: (member_expression
+ object: (identifier) @font-lock-type-face
+ property: (property_identifier)
@font-lock-type-face))
+
(arrow_function
parameter: (identifier) @font-lock-variable-name-face)
@@ -267,9 +275,7 @@
:language 'tsx
:override t
:feature 'property
- `(((property_identifier) @font-lock-property-face)
-
- (pair value: (identifier) @font-lock-variable-name-face)
+ `((pair value: (identifier) @font-lock-variable-name-face)
((shorthand_property_identifier) @font-lock-property-face)